diff --git a/src/widgets/mfa/MfaCredentialsWidget.tsx b/src/widgets/mfa/MfaCredentialsWidget.tsx index 2aa3116..cbe01c1 100644 --- a/src/widgets/mfa/MfaCredentialsWidget.tsx +++ b/src/widgets/mfa/MfaCredentialsWidget.tsx @@ -168,7 +168,7 @@ const MainView = ({ } - {config.mfaEmailEnabled && config.mfaSmsEnabled && !isPhoneCredentialRegistered && } + {config.mfaEmailEnabled && !isEmailCredentialRegistered && config.mfaSmsEnabled && !isPhoneCredentialRegistered && } {config.mfaSmsEnabled && !isPhoneCredentialRegistered &&
diff --git a/src/widgets/mfa/mfaListWidget.tsx b/src/widgets/mfa/mfaListWidget.tsx index 19ddc74..f584584 100644 --- a/src/widgets/mfa/mfaListWidget.tsx +++ b/src/widgets/mfa/mfaListWidget.tsx @@ -84,6 +84,10 @@ export type MfaListWidgetProps = { * The authorization credential JSON Web Token (JWT) used to access the ReachFive API, less than five minutes old. */ accessToken: string + /** + * Callback function called when the request has succeed. + */ + onSuccess?: () => void /** * Callback function called when the request has failed. */ @@ -94,10 +98,13 @@ export default createWidget({ component: MfaList, prepare: (options, { apiClient }) => apiClient.listMfaCredentials(options.accessToken) - .then(({ credentials }) => ({ - ...options, - credentials, - })) + .then(({ credentials }) => { + options.onSuccess?.() + return { + ...options, + credentials, + } + }) .catch(error => { options.onError?.(error) throw UserError.fromAppError(error) diff --git a/types/identity-ui.d.ts b/types/identity-ui.d.ts index 808f3aa..43de9d7 100644 --- a/types/identity-ui.d.ts +++ b/types/identity-ui.d.ts @@ -1,6 +1,6 @@ /** * @reachfive/identity-ui - v1.31.3 - * Compiled Fri, 31 Jan 2025 13:36:32 UTC + * Compiled Fri, 31 Jan 2025 14:43:05 UTC * * Copyright (c) ReachFive. * @@ -1487,6 +1487,10 @@ type MfaListWidgetProps = { * The authorization credential JSON Web Token (JWT) used to access the ReachFive API, less than five minutes old. */ accessToken: string; + /** + * Callback function called when the request has succeed. + */ + onSuccess?: () => void; /** * Callback function called when the request has failed. */