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

Properties

Provides branding-related configurations, such as branding theme and settings.
Provides client-related configurations, such as id, name, and logoUrl, for the login-passwordless-sms-otp screen.
Provides country code data for phone number entry, such as available and recommended, for the login-passwordless-sms-otp screen.
The active Experiment Center experiment for this screen, or null when no experiment is active (or the screen has not opted in via context_configuration).
Provides information about the user’s Organization, such as 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

Promise<void>
This method changes the display language of the Universal Login page.
Example
Method Parameters
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.
Returns a ResendControl object that manages resending with a cooldown. The startResend() method of the object triggers the resend and starts a cooldown period before the user can resend again. The countdown persists across the page reload that a resend causes.
Example
Method Parameters
Promise<void>
Resends the one-time password (OTP) to the user’s phone number.This method submits a form to Auth0. Auth0 renders this screen again. If a captcha is required, Auth0 sends the user back to the login-id screen instead, or to the signup-id screen if the user started from signup. In both cases, the browser loads a new page and the JavaScript context, including component state and timers, is lost.When you call resendOTP(), keep the following in mind:
  • Code that runs after await resendOTP() can’t rely on state that the code sets, such as a “code sent” message or a countdown.
  • If Auth0 can’t send the SMS, for example because of a rate limit, Auth0 renders this screen again without an error. Only extensibility errors, such as an error from an Action, and unexpected failures appear in transaction.errors after the page reloads. The returned promise doesn’t reject.
  • The returned promise resolves when the form is submitted, before the new page loads. The promise doesn’t confirm that Auth0 sent a new code.
To add a cooldown between resends, use resendManager(). The resendManager() method stores the countdown in localStorage, so the countdown persists across the page reload.
Example
Promise<void>
This method continues the login process using the OTP code.
Example
Method Parameters
Promise<void>
This method switches between a database connection (password) and a passwordless connection (Email/SMS OTP).
Example
Method Parameters