Bug fix - error toast in 2fa

This commit is contained in:
vinith-kovan 2024-06-13 19:14:31 +05:30
parent d8c764fc9e
commit 1b928e53da
No known key found for this signature in database
GPG Key ID: 9E663946A0AE5089
2 changed files with 9 additions and 11 deletions

View File

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

View File

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