Skip to main content
The EmailIdentifierChallenge class implements the email-identifier-challenge screen functionality. This screen prompts the user to enter a verification code sent to their email address to confirm their identity.

Constructors

Create an instance of EmailIdentifierChallenge screen manager
Example
import EmailIdentifierChallenge from '@auth0/auth0-acul-js/email-identifier-challenge';
const emailIdentifierChallenge = new EmailIdentifierChallenge();
emailIdentifierChallenge.submitEmailChallenge({
    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 email-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 email-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 email-identifier-challenge screen, such as active identifiers and flow states.
Handles untrusted data passed to the SDK, such as user input during the email challenge flow.
Details of the active user, including username, email, and roles.

Methods

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

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

const emailIdentifierChallenge = new EmailIdentifierChallenge();
emailIdentifierChallenge.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 EmailIdentifierChallenge from '@auth0/auth0-acul-js/email-identifier-challenge';
  const handleStatusChange = (remainingSeconds, isDisabled) => {
    setDisabled(isDisabled);
    setRemaining(remainingSeconds);
  };

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

  const { startResend } = emailChallenge.resendManager({
    timeoutSeconds: 15,
    onStatusChange: handleStatusChange,
    onTimeout: handleTimeout
  });
  
  // Call startResend when user clicks resend button
  await startResend();
options
OPTIONAL
Optional payload.
returnToPrevious
(options ?)
This method navigates the user back to the previous screen.
Example
import EmailIdentifierChallenge from '@auth0/auth0-acul-js/email-identifier-challenge';

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