Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
[bug] Ensure clients that always remember emails have an avenue to do…
Browse files Browse the repository at this point in the history
… so (#635)
  • Loading branch information
Addison Beck committed Jan 25, 2022
1 parent 946fc20 commit 4722a28
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions angular/src/components/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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();
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 4722a28

Please sign in to comment.