Skip to main content
The MfaPhoneChallenge class implements the mfa-phone-challenge screen functionality. This screen is displayed when the user needs to receive a code to verity their identity.

Constructors

Create an instance of MfaPhoneChallenge screen
Example
import MfaPhoneChallenge from '@auth0/auth0-acul-js/mfa-phone-challenge';

const mfaPhoneChallenge = new MfaPhoneChallenge();
// Request code via SMS
await mfaPhoneChallenge.continue({ type: 'sms' });
// Request code via Voice Call
await mfaPhoneChallenge.continue({ type: 'voice' });

Properties

branding
Provides branding-related configurations, such as branding theme and settings.
client
Provides client-related configurations, such as id, name, and logoUrl.
organization
Provides information about the user’s organization, such as organization id and name.
prompt
Contains data about the current prompt in the authentication flow.
screen
Contains details specific to the mfa-phone-challenge screen, including its configuration and context.
tenant
Contains data related to the tenant, such as id and associated metadata.
transaction
Provides transaction-specific data, such as active identifiers and flow states.
untrustedData
Handles untrusted data passed to the SDK, such as user input during login.
user
Details of the active user, including username, email, and roles.

Methods

continue
(options ?)
This method submits the user’s choice of receiving the MFA code via SMS or voice call. It uses the phone number provided in the screen context.
Example
const mfaPhoneChallenge = new MfaPhoneChallenge();
// Request code via SMS
await mfaPhoneChallenge.continue({ type: 'sms' });
// Request code via Voice Call
await mfaPhoneChallenge.continue({ type: 'voice' });
options
OPTIONAL
Options containing the delivery type (‘sms’ or ‘voice’).
getErrors
This method retrieves the array of transaction errors from the context, or an empty array if none exist.
pickPhone
(options ?)
This method initiates the process for the user to select a different phone number (if applicable). This typically triggers a navigation to a phone selection screen.
Example
const mfaPhoneChallenge = new MfaPhoneChallenge();
await mfaPhoneChallenge.pickPhone();
options
OPTIONAL
Optional custom options for the request.
tryAnotherMethod
(options ?)
This method allows the user to choose a different MFA method. For example: OTP or Recovery Code. This typically triggers navigation to the authenticator selection screen.
Example
const mfaPhoneChallenge = new MfaPhoneChallenge();
await mfaPhoneChallenge.tryAnotherMethod();
options
OPTIONAL
Optional custom options for the request.