Skip to main content
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.
Example
const mfaVoiceChallenge = new MfaVoiceChallenge();
mfaVoiceChallenge.continue({
  code: '123456',
  rememberDevice: true
});

Constructors

MfaVoiceChallenge
Constructor
Creates an instance of MfaVoiceChallenge.

Properties

branding
client
organization
prompt
screen
Screen-specific properties and data.
tenant
transaction
untrustedData
user
screenIdentifier
string
Screen identifier for validation and telemetry

Methods

continue
Promise<void>
Submits the voice verification code to validate the MFA challenge.Promise that resolves when the code is successfully validated
Example
const mfaVoiceChallenge = new MfaVoiceChallenge();
mfaVoiceChallenge.continue({
  code: '123456',
  rememberDevice: true
});
getErrors
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.
pickPhone
Promise<void>
Navigates to the screen for selecting a different phone number.Promise that resolves when navigation is complete
Example
const mfaVoiceChallenge = new MfaVoiceChallenge();
mfaVoiceChallenge.pickPhone();
resendCode
Promise<void>
Requests a new voice call with a verification code.Promise that resolves when the new code is sent
Example
const mfaVoiceChallenge = new MfaVoiceChallenge();
mfaVoiceChallenge.resendCode();
resendManager
Utility FeatureGets resend functionality with timeout management for this screenResendControl object with startResend method
Example
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();
switchToSms
Promise<void>
Switches to SMS verification method instead of voice call.Promise that resolves when switching is complete
Example
const mfaVoiceChallenge = new MfaVoiceChallenge();
mfaVoiceChallenge.switchToSms();
tryAnotherMethod
Promise<void>
Navigates to the screen for selecting an alternative MFA method.Promise that resolves when navigation is complete
Example
const mfaVoiceChallenge = new MfaVoiceChallenge();
mfaVoiceChallenge.tryAnotherMethod();