File tree Expand file tree Collapse file tree 1 file changed +63
-0
lines changed Expand file tree Collapse file tree 1 file changed +63
-0
lines changed Original file line number Diff line number Diff line change 1+ <script lang =" ts" >
2+ import api from " $endpoints" ;
3+
4+ export let username: string ;
5+ let originalPassword = " " ;
6+ let newPassword = " " ;
7+ let repeatNewPassword = " " ;
8+
9+ async function submitChangePassword() {
10+ await api ().admin .auth .change (username , originalPassword , newPassword );
11+ originalPassword = " " ;
12+ newPassword = " " ;
13+ repeatNewPassword = " " ;
14+ }
15+ </script >
16+
17+ <div >
18+ <h2 >Change authentication</h2 >
19+ <form on:submit ={submitChangePassword }>
20+ <p >
21+ Username
22+ <br />
23+ <input placeholder ="Your account username" bind:value ={username } />
24+ </p >
25+ <p >
26+ Original password
27+ <br />
28+ <input
29+ type =" password"
30+ placeholder =" Your original password"
31+ bind:value ={originalPassword }
32+ />
33+ </p >
34+ <p >
35+ New password
36+ <br />
37+ <input
38+ type =" password"
39+ placeholder =" A unique and secure password"
40+ bind:value ={newPassword }
41+ />
42+ </p >
43+ <p >
44+ Repeat new password
45+ <br />
46+ <input
47+ type =" password"
48+ placeholder =" Your new password again"
49+ bind:value ={repeatNewPassword }
50+ />
51+ </p >
52+ {#if newPassword != repeatNewPassword }
53+ <p >New passwords much match</p >
54+ {/if }
55+ <p >
56+ <input
57+ type =" submit"
58+ value =" Change password"
59+ disabled ={newPassword != repeatNewPassword }
60+ />
61+ </p >
62+ </form >
63+ </div >
You can’t perform that action at this time.
0 commit comments