Skip to content

Commit 9cdaa10

Browse files
committed
fix(profile): add a meaningful error message when call to MFA API fails.
* when call to MFA API fails on setting-auth page, display meaningful message instead of telling the user he has no active MFA tokens
1 parent 5756224 commit 9cdaa10

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

apps/user-profile/src/app/pages/settings-page/settings-authorization/mfa-settings/mfa-settings.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div [hidden]="loadingMfa">
33
<span
44
class="toggle-and-button"
5-
[matTooltip]="'AUTHENTICATION.MFA_DISABLED' | customTranslate | translate"
5+
[matTooltip]="errorTooltip | customTranslate | translate"
66
[matTooltipDisabled]="mfaAvailable"
77
matTooltipPosition="right">
88
<mat-slide-toggle

apps/user-profile/src/app/pages/settings-page/settings-authorization/mfa-settings/mfa-settings.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export class MfaSettingsComponent implements OnInit {
2323

2424
mfaAvailable = false;
2525
loadingMfa = false;
26+
errorTooltip = 'AUTHENTICATION.MFA_DISABLED';
2627

2728
enforceMfa: boolean;
2829
enableDetailSettings: boolean;
@@ -60,6 +61,7 @@ export class MfaSettingsComponent implements OnInit {
6061
},
6162
error: (err) => {
6263
console.error(err);
64+
this.errorTooltip = 'AUTHENTICATION.MFA_ERROR';
6365
this.loadingMfa = false;
6466
},
6567
});

apps/user-profile/src/assets/i18n/cs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
"MFA": "Vícefázové ověření",
140140
"MFA_TOGGLE": "Zapnout vícefázové ověření pro všechny služby",
141141
"MFA_DISABLED": "Potřebujete mít alespoň jeden aktivní MFA token.",
142+
"MFA_ERROR": "Při ověřování dostupnosti MFA došlo k chybě, prosím opakujte akci později.",
142143
"MFA_SAVE": "Uložit nastavení",
143144
"NEW_IMG": "Nový obrázek",
144145
"DELETE_IMG": "Vymazat obrázek",

apps/user-profile/src/assets/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
"MFA": "Multi-factor authentication",
140140
"MFA_TOGGLE": "Turn on multi-factor authentication for all services",
141141
"MFA_DISABLED": "You need to have at least one active MFA token.",
142+
"MFA_ERROR": "An error occurred while verifying MFA availability, please try again later.",
142143
"MFA_SAVE": "Save settings",
143144
"NEW_IMG": "New image",
144145
"DELETE_IMG": "Delete image",

0 commit comments

Comments
 (0)