-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the "change password" component functional
- Still needs a way to discover if the account is protected with the default static password or not. Probably need some local storage metadata for the account to know this.
- Loading branch information
Showing
6 changed files
with
83 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,38 @@ | ||
<p>password works!</p> | ||
<h1>Change your password</h1> | ||
|
||
<!-- TODO: Check if user has already set custom password, then change this into a change password dialog --> | ||
|
||
<button mat-flat-button (click)="changePassword('', '123', '123')">Save new password</button> | ||
<form (ngSubmit)="onSubmit()"> | ||
<mat-form-field appearance="outline" class="full-width"> | ||
<mat-label>Enter your old password</mat-label> | ||
<input matInput [formControl]="passwordInputPrevious" type="password" /> | ||
</mat-form-field> | ||
<br> | ||
|
||
<mat-form-field appearance="outline" class="full-width"> | ||
<mat-label>Enter your new password</mat-label> | ||
<input matInput [formControl]="passwordInput" type="password" /> | ||
</mat-form-field> | ||
<br> | ||
|
||
<mat-form-field appearance="outline" class="full-width"> | ||
<mat-label>Repeat your new password</mat-label> | ||
<input matInput [formControl]="passwordInputRepeat" type="password" /> | ||
</mat-form-field> | ||
|
||
| ||
<button mat-flat-button type="submit" color="primary" [disabled]="!(passwordInput.valid && !unlocking())"> | ||
@if(unlocking()) { | ||
<mat-spinner diameter="20"></mat-spinner> | ||
} @else { | ||
<span>Save new password</span> | ||
} | ||
</button> | ||
|
||
<p> | ||
@if (invalidPassword()) { | ||
<mat-error>Password is <strong>invalid</strong></mat-error> | ||
} | ||
</p> | ||
|
||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.full-width { | ||
width: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters