mirror of
https://github.com/bitwarden/browser
synced 2026-02-18 18:33:50 +00:00
Check cache before sending email for v1 component
This commit is contained in:
@@ -8,6 +8,7 @@ import { first } from "rxjs/operators";
|
||||
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { WINDOW } from "@bitwarden/angular/services/injection-tokens";
|
||||
import { TwoFactorFormCacheService } from "@bitwarden/auth/angular";
|
||||
import {
|
||||
LoginStrategyServiceAbstraction,
|
||||
LoginEmailServiceAbstraction,
|
||||
@@ -100,6 +101,7 @@ export class TwoFactorComponentV1 extends CaptchaProtectedComponent implements O
|
||||
protected masterPasswordService: InternalMasterPasswordServiceAbstraction,
|
||||
protected accountService: AccountService,
|
||||
protected toastService: ToastService,
|
||||
protected twoFactorFormCacheService: TwoFactorFormCacheService,
|
||||
) {
|
||||
super(environmentService, i18nService, platformUtilsService, toastService);
|
||||
|
||||
@@ -438,6 +440,10 @@ export class TwoFactorComponentV1 extends CaptchaProtectedComponent implements O
|
||||
return;
|
||||
}
|
||||
|
||||
if ((await this.twoFactorFormCacheService.getFormData()).emailSent) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((await this.loginStrategyService.getEmail()) == null) {
|
||||
this.toastService.showToast({
|
||||
variant: "error",
|
||||
|
||||
Reference in New Issue
Block a user