From 4722a287ec7212b8e67d02ec7ea1a9be0990ee6e Mon Sep 17 00:00:00 2001 From: Addison Beck Date: Tue, 25 Jan 2022 12:34:11 -0500 Subject: [PATCH] [bug] Ensure clients that always remember emails have an avenue to do so (#635) --- angular/src/components/login.component.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/angular/src/components/login.component.ts b/angular/src/components/login.component.ts index 5cfd6a6df4..e860ca9c15 100644 --- a/angular/src/components/login.component.ts +++ b/angular/src/components/login.component.ts @@ -35,6 +35,7 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit protected twoFactorRoute = "2fa"; protected successRoute = "vault"; protected forcePasswordResetRoute = "update-temp-password"; + protected alwaysRememberEmail: boolean = false; constructor( protected authService: AuthService, @@ -58,7 +59,9 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit this.email = ""; } } - this.rememberEmail = (await this.stateService.getRememberedEmail()) != null; + if (!this.alwaysRememberEmail) { + this.rememberEmail = (await this.stateService.getRememberedEmail()) != null; + } if (Utils.isBrowser && !Utils.isNode) { this.focusInput(); } @@ -95,7 +98,7 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit try { this.formPromise = this.authService.logIn(this.email, this.masterPassword, this.captchaToken); const response = await this.formPromise; - if (this.rememberEmail) { + if (this.rememberEmail || this.alwaysRememberEmail) { await this.stateService.setRememberedEmail(this.email); } else { await this.stateService.setRememberedEmail(null);