This method redirects the user to the social or enterprise identity provider (Idp) for authentiction.
Example
Report incorrect code
Copy
Ask AI
import LoginPassword from "@auth0/auth0-acul-js/login-id";const loginIdManager = new LoginPassword();// Check if alternateConnections is available and has at least one itemif (!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 purposesconsole.log(`Selected connection: ${selectedConnection.name}`);// Proceed with federated login using the selected connectionloginIdManager.federatedLogin({ connection: selectedConnection.name,});
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.
Example
Report incorrect code
Copy
Ask AI
import LoginPassword from "@auth0/auth0-acul-js/login-password";const loginPasswordManager = new LoginPassword();// Function to handle connection switchingconst handleSwitchConnection = (connectionName: string) => { loginPasswordManager.switchConnection({ connection: connectionName });};// Switch to different connection strategieshandleSwitchConnection('email'); // Switch to email-based authenticationhandleSwitchConnection('sms'); // Switch to SMS-based authentication
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.