MfaView
ComponentuserDevices
: Stores the list of MFA devices associated with the user.mfaRegisterData
: Stores the data required for MFA registration (QR code URI and secret).currentView
: Tracks the current view (e.g., ‘devices’, ‘qr-code’, ‘otp’, ‘backup-codes’).backupCodes
: Stores the backup codes for MFA.error
: Stores any error messages.useIsLoggedIn
: Checks if the user is logged in.useMfa
: Provides functions for managing MFA (e.g., addDevice
, authDevice
, getUserDevices
, getRecoveryCodes
, completeAcknowledgement
).useDynamicContext
: Provides user context and logout function.useEffect
: Refreshes user devices when the user logs in.useSyncMfaFlow
: Synchronizes the MFA flow based on the user’s authentication status.refreshUserDevices
: Fetches and sets the user’s MFA devices.onAddDevice
: Initiates the process of adding a new MFA device.onQRCodeContinue
: Proceeds to the OTP view after displaying the QR code.onOtpSubmit
: Authenticates the device using the provided OTP and fetches backup codes.DynamicWidget
for login.onSubmit
function with the entered OTP.HeadlessMfaView
ComponentMfaView
component.LogIn
component.