@auth0/auth0-acul-js - v1.0.0-alpha.2
    Preparing search index...

    Class LoginPassword

    Hierarchy

    • BaseContext
      • LoginPassword

    Implements

    Index

    Constructors

    Properties

    screenIdentifier: string = ScreenIds.LOGIN_PASSWORD

    Methods

    • Returns Promise<void>

      import LoginPassword from "@auth0/auth0-acul-js/login-id";
      const loginIdManager = new LoginPassword();

      // Check if alternateConnections is available and has at least one item
      if (!loginIdManager.transaction.alternateConnections) {
      console.error('No alternate connections available.');
      }

      // Select the first available connection (users can select any available connection)
      const selectedConnection = alternateConnections[0];

      // Log the chosen connection for debugging or informational purposes
      console.log(`Selected connection: ${selectedConnection.name}`);

      // Proceed with federated login using the selected connection
      loginIdManager.federatedLogin({
      connection: selectedConnection.name,
      });
    • Retrieves the array of transaction errors from the context, or an empty array if none exist.

      Returns Screens.Error[]

      An array of error objects from the transaction context.

    • Returns Promise<void>

      This method handles switching between DB connection (password) and Passwordless connection (Email/SMS OTP). The connection parameter should be one of: 'email', 'sms', or a DB connection name.

      import LoginPassword from "@auth0/auth0-acul-js/login-password";

      const loginPasswordManager = new LoginPassword();

      // Function to handle connection switching
      const handleSwitchConnection = (connectionName: string) => {
      loginPasswordManager.switchConnection({ connection: connectionName });
      };

      // Switch to different connection strategies
      handleSwitchConnection('email'); // Switch to email-based authentication
      handleSwitchConnection('sms'); // Switch to SMS-based authentication