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
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
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 resends functionality with timeout management for this screen. A ResendControl object with startResend method.
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
This methods resends the code to the user’s phone number.
import LoginPasswordlessSmsOtp from '@auth0/auth0-acul-js/login-passwordless-sms-otp' ;
const loginPasswordlessSmsOtp = new LoginPasswordlessSmsOtp ();
loginPasswordlessSmsOtp . resendOTP ();
Method Parameters
[`key`: `string`]
"string" | "number" | "boolean" | "undefined"
Additional data collected from the user.
This method continues the login process using the otp code.
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
The captcha code or response from the captcha provider. This property is required if your Auth0 tenant has Bot Detection enabled.
The code entered by the user.