Login Form password visibility (#4140)

* Login Form password visibility
This commit is contained in:
vincent12dev 2021-03-15 16:05:59 +01:00 committed by GitHub
parent 5820c5446b
commit 47e82b3cd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -51,7 +51,12 @@
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<mat-label translate>common.password</mat-label> <mat-label translate>common.password</mat-label>
<input id="password-input" matInput type="password" formControlName="password"/> <input id="password-input" matInput [type]="hidePassword ? 'password' : 'text'" formControlName="password"/>
<button mat-icon-button matSuffix type="button"
(click)="hidePassword = !hidePassword"
[attr.aria-pressed]="hidePassword">
<mat-icon>{{hidePassword ? 'visibility_off' : 'visibility'}}</mat-icon>
</button>
<mat-icon matPrefix>lock</mat-icon> <mat-icon matPrefix>lock</mat-icon>
</mat-form-field> </mat-form-field>
<div fxLayoutAlign="end center" class="forgot-password"> <div fxLayoutAlign="end center" class="forgot-password">

View File

@ -37,6 +37,7 @@ export class LoginComponent extends PageComponent implements OnInit {
password: '' password: ''
}); });
oauth2Clients: Array<OAuth2ClientInfo> = null; oauth2Clients: Array<OAuth2ClientInfo> = null;
hidePassword = true;
constructor(protected store: Store<AppState>, constructor(protected store: Store<AppState>,
private authService: AuthService, private authService: AuthService,