Browse Source

[bug] Ensure clients that always remember emails have an avenue to do so (#635)

pull/638/head
Addison Beck 4 years ago committed by GitHub
parent
commit
4722a287ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      angular/src/components/login.component.ts

7
angular/src/components/login.component.ts

@ -35,6 +35,7 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit @@ -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 @@ -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 @@ -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);

Loading…
Cancel
Save