1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 09:43:23 +00:00

toggle password visibility on login/register

This commit is contained in:
Kyle Spearrin
2018-02-24 13:45:41 -05:00
parent ccfc7b3eb1
commit 40e135a297
6 changed files with 61 additions and 13 deletions

View File

@@ -22,6 +22,7 @@ export class RegisterComponent {
masterPassword: string = '';
confirmMasterPassword: string = '';
hint: string = '';
showPassword: boolean = false;
formPromise: Promise<any>;
constructor(private authService: AuthService, private router: Router, private analytics: Angulartics2,
@@ -72,4 +73,10 @@ export class RegisterComponent {
const request = new RegisterRequest(this.email, hashedPassword, this.hint, encKey.encryptedString);
await this.apiService.postRegister(request);
}
togglePassword(confirmField: boolean) {
this.analytics.eventTrack.next({ action: 'Toggled Master Password on Register' });
this.showPassword = !this.showPassword;
document.getElementById(confirmField ? 'masterPasswordRetype' : 'masterPassword').focus();
}
}