1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 13:53:34 +00:00

Bug fix - error toast in 2fa (#9623)

* Bug fix - error toast in 2fa

* Bug fix - Yubikey code obscured

* 2FA error fix
This commit is contained in:
vinith-kovan
2024-07-01 21:33:51 +05:30
committed by GitHub
parent b060c15836
commit 432a4ddd17
2 changed files with 5 additions and 8 deletions

View File

@@ -78,15 +78,15 @@ export class TwoFactorEmailComponent extends TwoFactorBaseComponent {
} }
submit = async () => { submit = async () => {
this.formGroup.markAllAsTouched();
if (this.enabled) { if (this.enabled) {
await this.disableEmail(); await this.disableEmail();
this.onChangeStatus.emit(false); this.onChangeStatus.emit(false);
} else { } else {
this.formGroup.markAllAsTouched();
if (this.formGroup.invalid) { if (this.formGroup.invalid) {
return; return;
} }
await this.enable(); await this.enable();
this.onChangeStatus.emit(true); this.onChangeStatus.emit(true);
} }

View File

@@ -220,14 +220,11 @@ export class TwoFactorComponent extends CaptchaProtectedComponent implements OnI
this.token = this.token.replace(" ", "").trim(); this.token = this.token.replace(" ", "").trim();
} }
try {
await this.doSubmit(); await this.doSubmit();
} catch {
if (this.selectedProviderType === TwoFactorProviderType.WebAuthn && this.webAuthn != null) { if (this.selectedProviderType === TwoFactorProviderType.WebAuthn && this.webAuthn != null) {
this.webAuthn.start(); this.webAuthn.start();
} }
} }
}
async doSubmit() { async doSubmit() {
this.formPromise = this.loginStrategyService.logInTwoFactor( this.formPromise = this.loginStrategyService.logInTwoFactor(