Describes all the properties and methods available to customize the Universal Login login-passwordless-sms-otp screen.
The LoginPasswordlessSmsOtp class implements the login-passwordless-sms-otp screen functionality. This screen collects the user’s phone number and code.
Create an instance of LoginPasswordlessSmsOtp screen manager:
Example
import LoginPasswordlessSmsOtp from '@auth0/auth0-acul-js/login-passwordless-sms-otp';const loginPasswordlessSmsOtpManager = new LoginPasswordlessSmsOtp();loginPasswordlessSmsOtpManager.submitOTP({ code: '123456',});
This method changes the display language of the Universal Login page.
Example
import LoginPasswordlessSmsOtp from '@auth0/auth0-acul-js/login-passwordless-sms-otp';const loginPasswordlessSmsOtpManager = new LoginPasswordlessSmsOtp();loginPasswordlessSmsOtpManager.changeLanguage({ language: 'fr',});
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.
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 LoginPasswordlessSmsOtp from '@auth0/auth0-acul-js/login-passwordless-sms-otp';const loginPasswordlessSmsOtpManager = new LoginPasswordlessSmsOtp();const { startResend } = loginPasswordlessSmsOtpManager.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 buttonstartResend();
This method resends the code to the user’s phone number.
Example
import LoginPasswordlessSmsOtp from '@auth0/auth0-acul-js/login-passwordless-sms-otp';const loginPasswordlessSmsOtpManager = new LoginPasswordlessSmsOtp();loginPasswordlessSmsOtpManager.resendOTP();
This method continues the login process using the OTP code.
Example
import LoginPasswordlessSmsOtp from '@auth0/auth0-acul-js/login-passwordless-sms-otp';const loginPasswordlessSmsOtpManager = new LoginPasswordlessSmsOtp();loginPasswordlessSmsOtpManager.submitOTP({ code: '123456',});
This method switches between a database connection (password) and a passwordless connection (Email/SMS OTP).
Example
import LoginPasswordlessSmsOtp from '@auth0/auth0-acul-js/login-passwordless-sms-otp';const loginPasswordlessSmsOtpManager = new LoginPasswordlessSmsOtp();loginPasswordlessSmsOtpManager.switchConnection({ connection: 'sms',});