Email OTP Challenge screen class

The Email OTP Challenge screen class provides methods associated with the email-otp-challenge screen.

Import and instantiate the Email OTP Challenge screen class:

import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge';
const emailOTPChallenge = new EmailOTPChallenge();

Was this helpful?

/

Properties

The Email OTP Challenge screen class properties are:

interface branding {
  settings: null | BrandingSettings;
  themes: null | BrandingThemes;
}

interface BrandingSettings {
  colors?: {
    pageBackground?: string | {
      angleDeg: number;
      end: string;
      start: string;
      type: string;
    };
    primary?: string;
  };
  faviconUrl?: string;
  font?: {url: string;};
  logoUrl?: string;
}

interface BrandingThemes {
  default: {
    borders: Record<string, string | number | boolean>;
    colors: Record<string, string>;
    displayName: string;
    fonts: Record<string, string | boolean | object>;
    pageBackground: Record<string, string>;
    widget: Record<string, string | number>;
  };
}

Was this helpful?

/

Methods

The Email OTP Challenge screen class methods are:

getError( options? )

This method retrieves the array of transaction errors from context or an empty array if none exist.

import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge';
    const emailOTPChallengeManager = new EmailOTPChallenge();
    await emailOTPChallengeManager.getError();

Was this helpful?

/

resendCode( options ?)

This method requests a new OTP code to be sent to the user's email.

import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge';

const emailOTPChallenge = new EmailOTPChallenge();
emailOTPChallenge.resendCode();

Was this helpful?

/

Parameter                  Type Required Description
[key: string] string | number | boolean | undefined No Optional data collected from user.

submitCode( options ?)

This method submits the OTP code entered by the user.

import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge';

const emailOTPChallenge = new EmailOTPChallenge();
emailOTPChallenge.submitCode({
  code: '123456',
});

Was this helpful?

/

Parameter                  Type Required Description
code string Yes The code entered by the user.
[key: string] string | number | boolean | undefined No Optional data collected from user.