Bug fix - error toast in 2fa
This commit is contained in:
parent
d8c764fc9e
commit
1b928e53da
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue