MFA Voice Challenge screen implementation.
This screen is displayed when a user needs to verify their identity using a voice call
as part of a multi-factor authentication flow.
const mfaVoiceChallenge = new MfaVoiceChallenge ();
mfaVoiceChallenge . continue ({
code: '123456' ,
rememberDevice: true
});
Constructors
Creates an instance of MfaVoiceChallenge.
Properties
Screen-specific properties and data.
Screen identifier for validation and telemetry
Methods
Submits the voice verification code to validate the MFA challenge. Promise that resolves when the code is successfully validated const mfaVoiceChallenge = new MfaVoiceChallenge ();
mfaVoiceChallenge . continue ({
code: '123456' ,
rememberDevice: true
});
Retrieves the array of transaction errors from the context, or an empty array if none exist. An array of error objects from the transaction context.
Navigates to the screen for selecting a different phone number. Promise that resolves when navigation is complete const mfaVoiceChallenge = new MfaVoiceChallenge ();
mfaVoiceChallenge . pickPhone ();
Optional custom parameters
Requests a new voice call with a verification code. Promise that resolves when the new code is sent const mfaVoiceChallenge = new MfaVoiceChallenge ();
mfaVoiceChallenge . resendCode ();
Optional custom parameters
Utility FeatureGets resend functionality with timeout management for this screen ResendControl object with startResend method import MfaVoiceChallenge from '@auth0/auth0-acul-js/mfa-voice-challenge' ;
const mfaVoiceChallenge = new MfaVoiceChallenge ();
const { startResend } = mfaVoiceChallenge . resendManager ({
timeoutSeconds: 15 ,
onStatusChange : ( remainingSeconds , isDisabled ) => {
console . log ( `Resend available in ${ remainingSeconds } s, disabled: ${ isDisabled } ` );
},
onTimeout : () => {
console . log ( 'Resend is now available' );
}
});
// Call startResend when user clicks resend button
startResend ();
Configuration options for resend functionality Properties
Switches to SMS verification method instead of voice call. Promise that resolves when switching is complete const mfaVoiceChallenge = new MfaVoiceChallenge ();
mfaVoiceChallenge . switchToSms ();
Optional custom parameters
Navigates to the screen for selecting an alternative MFA method. Promise that resolves when navigation is complete const mfaVoiceChallenge = new MfaVoiceChallenge ();
mfaVoiceChallenge . tryAnotherMethod ();
Optional custom parameters