Skip to main content
The LoginPasswordlessSmsOtp class implements the login-passwordless-sms-otp screen functionality. This screen collects the user’s phone number and code.

Constructors

Create an instance of LoginPasswordlessSmsOtp screen manager
Example
import LoginPasswordlessSmsOtp from '@auth0/auth0-acul-js/login-passwordless-sms-otp';

const loginPasswordlessSmsOtp = new LoginPasswordlessSmsOtp();
const { startResend } = loginPasswordlessSmsOtp.resendManager({
  timeoutSeconds: 15,
  onStatusChange: (remainingSeconds, isDisabled) => {
    console.log(`Resend available in ${remainingSeconds}s, disabled: ${isDisabled}`);
  },
  onTimeout: () => {
    console.log('Resend is now available');
  }
});

// Call startResend when user clicks resend button
startResend();

Properties

Provides branding-related configurations, such as branding theme and settings.
Provides client-related configurations, such as id, name, and logoUrl.
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 login-passwordless-sms-otp screen, including its configuration and context.
Contains data related to the tenant, such as id and associated metadata.
Provides transaction-specific data for the login-passwordless-sms-otp screen, such as active identifiers and flow states.
Handles untrusted data passed to the SDK, such as user input during login.
Details of the active user, including username, email, and roles.

Methods

getErrors
This method 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.
resendManager
(options ?)
This method resends functionality with timeout management for this screen. A ResendControl object with startResend method.
Example
import LoginPasswordlessSmsOtp from '@auth0/auth0-acul-js/login-passwordless-sms-otp';

const loginPasswordlessSmsOtp = new LoginPasswordlessSmsOtp();
const { startResend } = loginPasswordlessSmsOtp.resendManager({
  timeoutSeconds: 15,
  onStatusChange: (remainingSeconds, isDisabled) => {
    console.log(`Resend available in ${remainingSeconds}s, disabled: ${isDisabled}`);
  },
  onTimeout: () => {
    console.log('Resend is now available');
  }
});

// Call startResend when user clicks resend button
startResend();
Method Parameters
resendOTP
(options ?)
This methods resends the code to the user’s phone number.
Example
import LoginPasswordlessSmsOtp from '@auth0/auth0-acul-js/login-passwordless-sms-otp';

const loginPasswordlessSmsOtp = new LoginPasswordlessSmsOtp();
loginPasswordlessSmsOtp.resendOTP();
Method Parameters
submitOTP
(options ?)
This method continues the login process using the otp code.
Example
import LoginPasswordlessSmsOtp from '@auth0/auth0-acul-js/login-passwordless-sms-otp';
const loginPasswordlessSmsOtp = new LoginPasswordlessSmsOtp();

loginPasswordlessSmsOtp.submitOTP({
    username: "test@domain.com";
    code: "<string>";
});
Method Parameters