diff --git a/apps/web/src/app/auth/settings/two-factor-base.component.ts b/apps/web/src/app/auth/settings/two-factor-base.component.ts index f909f83e78..ac8906641d 100644 --- a/apps/web/src/app/auth/settings/two-factor-base.component.ts +++ b/apps/web/src/app/auth/settings/two-factor-base.component.ts @@ -48,7 +48,6 @@ export abstract class TwoFactorBaseComponent { this.onUpdated.emit(true); } catch (e) { this.logService.error(e); - throw e; } } diff --git a/apps/web/src/app/auth/settings/two-factor-setup.component.ts b/apps/web/src/app/auth/settings/two-factor-setup.component.ts index 6f80f17bd2..8be6c7a3cc 100644 --- a/apps/web/src/app/auth/settings/two-factor-setup.component.ts +++ b/apps/web/src/app/auth/settings/two-factor-setup.component.ts @@ -160,10 +160,12 @@ export class TwoFactorSetupComponent implements OnInit, OnDestroy { if (!result) { return; } - const yubiComp = await this.openModal(this.yubikeyModalRef, TwoFactorYubiKeyComponent); - yubiComp.auth(result); - this.twoFactorSetupSubscription = yubiComp.onUpdated - .pipe(first(), takeUntil(this.destroy$)) + const yubiComp: DialogRef = TwoFactorYubiKeyComponent.open( + this.dialogService, + { data: result }, + ); + yubiComp.componentInstance.onUpdated + .pipe(takeUntil(this.destroy$)) .subscribe((enabled: boolean) => { this.updateStatus(enabled, TwoFactorProviderType.Yubikey); }); @@ -266,7 +268,7 @@ export class TwoFactorSetupComponent implements OnInit, OnDestroy { this.modal.close(); } this.providers.forEach((p) => { - if (p.type === type) { + if (p.type === type && enabled !== undefined) { p.enabled = enabled; } }); diff --git a/apps/web/src/app/auth/settings/two-factor-yubikey.component.html b/apps/web/src/app/auth/settings/two-factor-yubikey.component.html index 514ba2ac96..098669d752 100644 --- a/apps/web/src/app/auth/settings/two-factor-yubikey.component.html +++ b/apps/web/src/app/auth/settings/two-factor-yubikey.component.html @@ -1,118 +1,84 @@ -