From e626233121d66397239a7185fcee0edd2f36a7e5 Mon Sep 17 00:00:00 2001 From: Jared Snider Date: Thu, 23 Jan 2025 17:49:23 -0500 Subject: [PATCH] PM-8113 - TwoFactorAuth - build submitting loading logic --- .../two-factor-auth.component.html | 81 +++++++++---------- .../two-factor-auth.component.ts | 4 + 2 files changed, 43 insertions(+), 42 deletions(-) diff --git a/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.html b/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.html index e9717f7a0e..7bae5cc159 100644 --- a/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.html +++ b/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.html @@ -1,11 +1,11 @@ - -
- -
-
+
+ +
+ +
+
- - + + {{ "rememberMe" | i18n }} - +

{{ "noTwoStepProviders" | i18n }}

{{ "noTwoStepProviders2" | i18n }}

- -
- - + - - {{ "cancel" | i18n }} - -
- - -
+ +
+ + + + + {{ "cancel" | i18n }} + +
+ + diff --git a/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.ts b/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.ts index 6dfcde224c..47fbe77f33 100644 --- a/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.ts +++ b/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.ts @@ -220,12 +220,14 @@ export class TwoFactorAuthComponent implements OnInit, OnDestroy { } async submit() { + this.loading = true; if (this.token == null || this.token === "") { this.toastService.showToast({ variant: "error", title: this.i18nService.t("errorOccurred"), message: this.i18nService.t("verificationCodeRequired"), }); + this.loading = false; return; } @@ -243,6 +245,8 @@ export class TwoFactorAuthComponent implements OnInit, OnDestroy { title: this.i18nService.t("errorOccurred"), message: this.i18nService.t("invalidVerificationCode"), }); + } finally { + this.loading = false; } }