Commit 47e82b3cd7d7fa5fa8d2795c29a56764775d17c8

Authored by vincent12dev
Committed by GitHub
1 parent 5820c544

Login Form password visibility (#4140)

* Login Form password visibility
... ... @@ -51,7 +51,12 @@
51 51 </mat-form-field>
52 52 <mat-form-field>
53 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 60 <mat-icon matPrefix>lock</mat-icon>
56 61 </mat-form-field>
57 62 <div fxLayoutAlign="end center" class="forgot-password">
... ...
... ... @@ -37,7 +37,8 @@ export class LoginComponent extends PageComponent implements OnInit {
37 37 password: ''
38 38 });
39 39 oauth2Clients: Array<OAuth2ClientInfo> = null;
40   -
  40 + hidePassword = true;
  41 +
41 42 constructor(protected store: Store<AppState>,
42 43 private authService: AuthService,
43 44 public fb: FormBuilder,
... ...