Skip to main content
Login Passwordless Email Code
Example
import LoginPasswordlessEmailCode from '@auth0/auth0-acul-js/login-passwordless-email-code';

const loginPasswordlessEmailCode = new LoginPasswordlessEmailCode();
const { startResend } = loginPasswordlessEmailCode.resendManager({
  timeoutSeconds: 60,
  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();

Constructors

LoginPasswordlessEmailCode
Constructor

Properties

branding
client
organization
prompt
screen
tenant
transaction
untrustedData
user
screenIdentifier
string

Methods

getErrors
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.
resendCode
Promise<void>
Example
import LoginPasswordlessEmailCode from '@auth0/auth0-acul-js/login-passwordless-email-code';

const loginPasswordlessEmailCode = new LoginPasswordlessEmailCode();
loginPasswordlessEmailCode.resendCode();
resendManager
Utility FeatureCreates a resend control manager for handling email code resend operations.A ResendControl object with resend functionality and state management
Example
import LoginPasswordlessEmailCode from '@auth0/auth0-acul-js/login-passwordless-email-code';

const loginPasswordlessEmailCode = new LoginPasswordlessEmailCode();
const { startResend } = loginPasswordlessEmailCode.resendManager({
  timeoutSeconds: 60,
  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();
submitCode
Promise<void>
Example
//Creates an instance of LoginPasswordlessEmailCode and calls the method with sample data.
import LoginPasswordlessEmailCode from '@auth0/auth0-acul-js/login-passwordless-email-code';

//Method to continue the login process using email and code.
const loginPasswordlessEmailCode = new LoginPasswordlessEmailCode();
loginPasswordlessEmailCode.submitCode({
 email: "[email protected]";
 code: "<string>";
});