Commit 47e82b3cd7d7fa5fa8d2795c29a56764775d17c8
Committed by
GitHub
1 parent
5820c544
Login Form password visibility (#4140)
* Login Form password visibility
Showing
2 changed files
with
8 additions
and
2 deletions
@@ -51,7 +51,12 @@ | @@ -51,7 +51,12 @@ | ||
51 | </mat-form-field> | 51 | </mat-form-field> |
52 | <mat-form-field> | 52 | <mat-form-field> |
53 | <mat-label translate>common.password</mat-label> | 53 | <mat-label translate>common.password</mat-label> |
54 | - <input id="password-input" matInput type="password" formControlName="password"/> | 54 | + <input id="password-input" matInput [type]="hidePassword ? 'password' : 'text'" formControlName="password"/> |
55 | + <button mat-icon-button matSuffix type="button" | ||
56 | + (click)="hidePassword = !hidePassword" | ||
57 | + [attr.aria-pressed]="hidePassword"> | ||
58 | + <mat-icon>{{hidePassword ? 'visibility_off' : 'visibility'}}</mat-icon> | ||
59 | + </button> | ||
55 | <mat-icon matPrefix>lock</mat-icon> | 60 | <mat-icon matPrefix>lock</mat-icon> |
56 | </mat-form-field> | 61 | </mat-form-field> |
57 | <div fxLayoutAlign="end center" class="forgot-password"> | 62 | <div fxLayoutAlign="end center" class="forgot-password"> |
@@ -37,7 +37,8 @@ export class LoginComponent extends PageComponent implements OnInit { | @@ -37,7 +37,8 @@ export class LoginComponent extends PageComponent implements OnInit { | ||
37 | password: '' | 37 | password: '' |
38 | }); | 38 | }); |
39 | oauth2Clients: Array<OAuth2ClientInfo> = null; | 39 | oauth2Clients: Array<OAuth2ClientInfo> = null; |
40 | - | 40 | + hidePassword = true; |
41 | + | ||
41 | constructor(protected store: Store<AppState>, | 42 | constructor(protected store: Store<AppState>, |
42 | private authService: AuthService, | 43 | private authService: AuthService, |
43 | public fb: FormBuilder, | 44 | public fb: FormBuilder, |