mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-06 09:20:43 +01:00
[bug] Ensure clients that always remember emails have an avenue to do so (#635)
This commit is contained in:
parent
946fc20674
commit
4722a287ec
@ -35,6 +35,7 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit
|
|||||||
protected twoFactorRoute = "2fa";
|
protected twoFactorRoute = "2fa";
|
||||||
protected successRoute = "vault";
|
protected successRoute = "vault";
|
||||||
protected forcePasswordResetRoute = "update-temp-password";
|
protected forcePasswordResetRoute = "update-temp-password";
|
||||||
|
protected alwaysRememberEmail: boolean = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected authService: AuthService,
|
protected authService: AuthService,
|
||||||
@ -58,7 +59,9 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit
|
|||||||
this.email = "";
|
this.email = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.rememberEmail = (await this.stateService.getRememberedEmail()) != null;
|
if (!this.alwaysRememberEmail) {
|
||||||
|
this.rememberEmail = (await this.stateService.getRememberedEmail()) != null;
|
||||||
|
}
|
||||||
if (Utils.isBrowser && !Utils.isNode) {
|
if (Utils.isBrowser && !Utils.isNode) {
|
||||||
this.focusInput();
|
this.focusInput();
|
||||||
}
|
}
|
||||||
@ -95,7 +98,7 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit
|
|||||||
try {
|
try {
|
||||||
this.formPromise = this.authService.logIn(this.email, this.masterPassword, this.captchaToken);
|
this.formPromise = this.authService.logIn(this.email, this.masterPassword, this.captchaToken);
|
||||||
const response = await this.formPromise;
|
const response = await this.formPromise;
|
||||||
if (this.rememberEmail) {
|
if (this.rememberEmail || this.alwaysRememberEmail) {
|
||||||
await this.stateService.setRememberedEmail(this.email);
|
await this.stateService.setRememberedEmail(this.email);
|
||||||
} else {
|
} else {
|
||||||
await this.stateService.setRememberedEmail(null);
|
await this.stateService.setRememberedEmail(null);
|
||||||
|
Loading…
Reference in New Issue
Block a user