Skip to main content
The PhoneIdentifierChallenge class implements the phone-identifier-challenge screen functionality. This screen prompts the user to enter a verification code sent to their phone number to confirm their identity.
undefined

Constructors

Create an instance of PhoneIdentifierChallenge screen manager
Example
import PhoneIdentifierChallenge from '@auth0/auth0-acul-js/phone-identifier-challenge';
const phoneIdentifierChallenge = new PhoneIdentifierChallenge();
phoneIdentifierChallenge.submitPhoneChallenge({
    code: "<string>"
});

Properties

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

Methods

submitPhoneChallenge
(options ?)
This method submits the phone verification code to complete the challenge.
Example
import PhoneIdentifierChallenge from '@auth0/auth0-acul-js/phone-identifier-challenge';

const phoneIdentifierChallenge = new PhoneIdentifierChallenge();
phoneIdentifierChallenge.submitPhoneChallenge({
    code: "<string>"
});
options
OPTIONAL
Optional payload.
resendCode
(options ?)
This method resends the verification code to the user’s phone number.
Example
import PhoneIdentifierChallenge from '@auth0/auth0-acul-js/phone-identifier-challenge';

const phoneIdentifierChallenge = new PhoneIdentifierChallenge();
phoneIdentifierChallenge.resendCode();
options
OPTIONAL
Optional payload.
resendManager
This method provides resend functionality with timeout management. It returns a ResendControl object with a startResend() method that triggers the resend and enforces a cooldown period before the user can resend again.
Example
import PhoneIdentifierChallenge from '@auth0/auth0-acul-js/phone-identifier-challenge';
  const handleStatusChange = (remainingSeconds, isDisabled) => {
    setDisabled(isDisabled);
    setRemaining(remainingSeconds);
  };

  const handleTimeout = () => {
    console.log('Timeout completed, resend is now available');
  };

  const { startResend } = phoneChallenge.resendManager({
    timeoutSeconds: 30,
    onStatusChange: handleStatusChange,
    onTimeout: handleTimeout
  });
  
  // Call startResend when user clicks resend button
  await startResend();
options
OPTIONAL
Optional payload.
switchToText
(options ?)
This method switches the delivery method for the verification code to SMS text message.
Example
import PhoneIdentifierChallenge from '@auth0/auth0-acul-js/phone-identifier-challenge';

const phoneIdentifierChallenge = new PhoneIdentifierChallenge();
phoneIdentifierChallenge.switchToText();
options
OPTIONAL
Optional payload.
switchToVoice
(options ?)
This method switches the delivery method for the verification code to a voice call.
Example
import PhoneIdentifierChallenge from '@auth0/auth0-acul-js/phone-identifier-challenge';

const phoneIdentifierChallenge = new PhoneIdentifierChallenge();
phoneIdentifierChallenge.switchToVoice();
options
OPTIONAL
Optional payload.
returnToPrevious
(options ?)
This method navigates the user back to the previous screen.
Example
import PhoneIdentifierChallenge from '@auth0/auth0-acul-js/phone-identifier-challenge';

const phoneIdentifierChallenge = new PhoneIdentifierChallenge();
phoneIdentifierChallenge.returnToPrevious();
options
OPTIONAL
Optional payload.
getErrors
This method retrieves the array of transaction errors from the context, or an empty array if none exist.