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

Constructors

MfaPhoneChallenge
Constructor
Initializes a new instance of the MfaPhoneChallenge class. It sets up the screen-specific data by creating an instance of ScreenOverride.

Properties

branding
client
organization
prompt
screen
Holds the specific screen data for the MFA Phone Challenge.
tenant
transaction
untrustedData
user
screenIdentifier
string
The unique identifier for this screen.

Methods

continue
Promise<void>
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.A promise that resolves upon successful submission.

Throws

Throws an error if the phone number is not available in the screen context or if the submission fails.
Example
const mfaPhoneChallenge = new MfaPhoneChallenge();
// Request code via SMS
await mfaPhoneChallenge.continue({ type: 'sms' });
// Request code via Voice Call
await mfaPhoneChallenge.continue({ type: 'voice' });
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>
Initiates the process for the user to select a different phone number (if applicable). This typically triggers a navigation to a phone selection screen.A promise that resolves upon successful submission.

Throws

Throws an error if the submission fails.
Example
const mfaPhoneChallenge = new MfaPhoneChallenge();
await mfaPhoneChallenge.pickPhone();
tryAnotherMethod
Promise<void>
Allows the user to choose a different MFA method (e.g., OTP, Recovery Code). This typically triggers navigation to the authenticator selection screen.A promise that resolves upon successful submission.

Throws

Throws an error if the submission fails.
Example
const mfaPhoneChallenge = new MfaPhoneChallenge();
await mfaPhoneChallenge.tryAnotherMethod();