The LoginEmailVerification manages interactions for the login-email-verification screen.
This screen prompts the user to enter a one-time code sent to their email address
to verify their identity during the login process.
Create an instance of LoginEmailVerification screen manager
Example
Report incorrect code
Copy
Ask AI
// How to use the LoginEmailVerification screen SDK:import LoginEmailVerification from '@auth0/auth0-acul-js/login-email-verification';// Instantiate the manager for the login email verification screenconst loginEmailVerificationManager = new LoginEmailVerification();
This method submits the email verification code entered by the user to Auth0.
This method prepares and posts the form data, including the verification code and the required action: "default", to the /u/login-email-verification endpoint.
Example
Report incorrect code
Copy
Ask AI
const manager = new LoginEmailVerification();// Assuming 'userInputCode' is a string obtained from a form inputmanager.continueWithCode({ code: userInputCode }) .catch(err => { // Handle unexpected submission errors displayGlobalError("Could not submit your code. Please try again."); });// After the operation, check manager.transaction.errors for validation messages.
This method requests Auth0 to send a new verification code to the user’s email address.
This is typically used when the user didn’t receive the original code, or it has expired.
Example
Report incorrect code
Copy
Ask AI
const manager = new LoginEmailVerification();manager.resendCode() .then(() => { // Inform the user that a new code has been sent. showNotification("A new verification code is on its way!"); }) .catch(err => { // Handle unexpected submission errors displayGlobalError("Could not request a new code. Please try again later."); });// After the operation, check manager.transaction.errors for specific issues.
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.