> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev-actions-triggers-prototype.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# LoginPasswordlessEmailCode

> Describes all the properties and methods available to customize the Universal Login `login-passwordless-email-code` screen.

The LoginPasswordlessEmailCode class implements the `login-passwordless-email-code` screen functionality. This screen collects the user's email and code.

<Frame>
  <img style={{maxHeight:"400px"}} src="https://mintcdn.com/docs-dev-actions-triggers-prototype/pJYW9vLPIqzUNcly/docs/images/cdy7uua7fh8z/4DKgjU2dGw0mpLJKGfGhp0/470b29266da87f9bfc3e7eef55069620/Login_Passwordless_Email_Code.png?fit=max&auto=format&n=pJYW9vLPIqzUNcly&q=85&s=06f7e10f4eab1b0af4fbefbba50bd943" alt="Login Passwordless Email Code" width="480" height="576" data-path="docs/images/cdy7uua7fh8z/4DKgjU2dGw0mpLJKGfGhp0/470b29266da87f9bfc3e7eef55069620/Login_Passwordless_Email_Code.png" />
</Frame>

## Constructors

Create an instance of LoginPasswordlessEmailCode screen manager:

```typescript Example theme={null}
import LoginPasswordlessEmailCode from '@auth0/auth0-acul-js/login-passwordless-email-code';
const loginPasswordlessEmailCodeManager = new LoginPasswordlessEmailCode();
loginPasswordlessEmailCodeManager.submitCode({
  code: '123456',
});
```

## Properties

<ParamField body="branding" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/BrandingMembers">BrandingMembers</a></span>}>
  Provides branding-related configurations, such as branding theme and settings.
</ParamField>

<ParamField body="client" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/ClientMembers">ClientMembers</a></span>}>
  Provides client-related configurations, such as `id`, `name`, and `logoUrl`, for the `login-passwordless-email-code` screen.
</ParamField>

<ParamField body="organization" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/OrganizationMembers">OrganizationMembers</a></span>}>
  Provides information about the user's Organization, such as `id` and `name`.
</ParamField>

<ParamField body="prompt" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/PromptMembers">PromptMembers</a></span>}>
  Contains data about the current prompt in the authentication flow.
</ParamField>

<ParamField body="screen" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/ScreenMembersOnLoginPasswordlessEmailCode">ScreenMembersOnLoginPasswordlessEmailCode</a></span>}>
  Contains details specific to the `login-passwordless-email-code` screen, including its configuration and context.
</ParamField>

<ParamField body="tenant" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/TenantMembers">TenantMembers</a></span>}>
  Contains data related to the tenant, such as `id` and associated metadata.
</ParamField>

<ParamField body="transaction" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/TransactionMembersOnLoginPasswordlessEmailCode">TransactionMembersOnLoginPasswordlessEmailCode</a></span>}>
  Provides transaction-specific data for the `login-passwordless-email-code` screen, such as active identifiers and flow states.
</ParamField>

<ParamField body="untrustedData" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/UntrustedDataMembers">UntrustedDataMembers</a></span>}>
  Handles untrusted data passed to the SDK, such as user input during login.
</ParamField>

<ParamField body="user" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/UserMembers">UserMembers</a></span>}>
  Details of the active user, including `username`, `email`, and `roles`.
</ParamField>

## Methods

<ParamField body="changeLanguage" type="Promise<void>">
  This method changes the display language of the Universal Login page.

  ```typescript Example theme={null}
  import LoginPasswordlessEmailCode from '@auth0/auth0-acul-js/login-passwordless-email-code';
  const loginPasswordlessEmailCodeManager = new LoginPasswordlessEmailCode();
  loginPasswordlessEmailCodeManager.changeLanguage({
    language: 'fr',
  });
  ```

  **Method Parameters**

  <Expandable title="Parameters">
    <ParamField body="options">
      [LanguageChangeOptions](/docs/libraries/acul/js-sdk/Screens/interfaces/LanguageChangeOptions).
    </ParamField>

    <ParamField body="language" type="string" required>
      The locale code for the desired language (for example, `'en'`, `'fr'`, `'es'`).
    </ParamField>

    <ParamField body="persist?" type="&#x22;session&#x22;">
      When set to `'session'`, the selected language persists for the duration of the session.
    </ParamField>

    <ParamField body="[`key`: `string`]" type="&#x22;string&#x22; | &#x22;number&#x22; | &#x22;boolean&#x22; | &#x22;undefined&#x22;">
      Additional custom fields prefixed with `ulp-` (for example, `'ulp-custom-field'`).
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="getErrors" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/Error">Error</a>[]</span>}>
  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.
</ParamField>

<ParamField body="resendCode" type="Promise<void>">
  This method resends the code to the user's email address.

  ```typescript Example theme={null}
  import LoginPasswordlessEmailCode from '@auth0/auth0-acul-js/login-passwordless-email-code';
  const loginPasswordlessEmailCodeManager = new LoginPasswordlessEmailCode();
  loginPasswordlessEmailCodeManager.resendCode();
  ```

  **Method Parameters**

  <Expandable title="Parameters">
    <ParamField body="options">
      [CustomOptions](/docs/libraries/acul/js-sdk/Screens/interfaces/CustomOptions).
    </ParamField>

    <ParamField body="[`key`: `string`]" type="&#x22;string&#x22; | &#x22;number&#x22; | &#x22;boolean&#x22; | &#x22;undefined&#x22;">
      Additional custom fields prefixed with `ulp-` (for example, `'ulp-custom-field'`).
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="resendManager" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/interfaces/ResendControl">ResendControl</a></span>}>
  This method provides resend functionality with timeout management. It returns a [`ResendControl`](/docs/libraries/acul/js-sdk/Screens/interfaces/ResendControl) object with a `startResend()` method that triggers the resend and enforces a cooldown period before the user can resend again.

  ```typescript Example theme={null}
  import LoginPasswordlessEmailCode from '@auth0/auth0-acul-js/login-passwordless-email-code';

  const loginPasswordlessEmailCodeManager = new LoginPasswordlessEmailCode();
  const { startResend } = loginPasswordlessEmailCodeManager.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**

  <Expandable title="Parameters">
    <ParamField body="options">
      [StartResendOptions](/docs/libraries/acul/js-sdk/Screens/interfaces/StartResendOptions).
    </ParamField>

    <ParamField body="timeoutSeconds?" type="number">
      The cooldown duration in seconds before the user can resend the code again.
    </ParamField>

    <ParamField body="onStatusChange?" type={<span><a href="/docs/libraries/acul/js-sdk/Screens/type-aliases/OnStatusChangeCallback">OnStatusChangeCallback</a></span>}>
      Callback invoked whenever the resend status changes, it returns the remaining seconds and if the resend functionality is currently disabled.
    </ParamField>

    <ParamField body="onTimeout?" type="() => void">
      Callback invoked when the cooldown expires and resend becomes available again.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="submitCode" type="Promise<void>">
  This method continues the login process using the email code.

  ```typescript Example theme={null}
  import LoginPasswordlessEmailCode from '@auth0/auth0-acul-js/login-passwordless-email-code';
  const loginPasswordlessEmailCodeManager = new LoginPasswordlessEmailCode();
  loginPasswordlessEmailCodeManager.submitCode({
    code: '123456',
  });
  ```

  **Method Parameters**

  <Expandable title="Parameters">
    <ParamField body="options">
      [SubmitCodeOptions](/docs/libraries/acul/js-sdk/Screens/interfaces/SubmitCodeOptions).
    </ParamField>

    <ParamField body="code" type="string | number" required>
      The code entered by the user.
    </ParamField>

    <ParamField body="captcha?" type="string">
      The captcha code or response from the captcha provider. This property is required if your Auth0 tenant has [Bot Detection](/docs/secure/attack-protection/bot-detection) enabled.
    </ParamField>

    <ParamField body="[`key`: `string`]" type="&#x22;string&#x22; | &#x22;number&#x22; | &#x22;boolean&#x22; | &#x22;undefined&#x22;">
      Additional custom fields prefixed with `ulp-` (for example, `'ulp-custom-field'`).
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="switchConnection" type="Promise<void>">
  This method switches between a database connection (password) and a passwordless connection (Email/SMS OTP).

  ```typescript Example theme={null}
  import LoginPasswordlessEmailCode from '@auth0/auth0-acul-js/login-passwordless-email-code';
  const loginPasswordlessEmailCodeManager = new LoginPasswordlessEmailCode();
  loginPasswordlessEmailCodeManager.switchConnection({
    connection: 'email',
  });
  ```

  **Method Parameters**

  <Expandable title="Parameters">
    <ParamField body="options">
      [SwitchConnectionOptionsEmailCode](/docs/libraries/acul/js-sdk/Screens/interfaces/SwitchConnectionOptionsEmailCode).
    </ParamField>

    <ParamField body="connection" type="string" required>
      The connection name to switch to. Use `'email'` or `'sms'` for passwordless, or a DB connection name for password-based authentication.
    </ParamField>

    <ParamField body="[`key`: `string`]" type="&#x22;string&#x22; | &#x22;number&#x22; | &#x22;boolean&#x22;">
      Additional custom fields prefixed with `ulp-` (for example, `'ulp-custom-field'`).
    </ParamField>
  </Expandable>
</ParamField>
