Passer au contenu principal
Représente l’écran de défi One‑Time Password (OTP) par courriel.
Example
import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge';

const emailOTPChallenge = new EmailOTPChallenge();
emailOTPChallenge.submitCode({
  code: '123456',
});

Constructeurs

EmailOTPChallenge
Constructor

Propriétés

branding
client
organization
prompt
screen
tenant
transaction
untrustedData
user
screenIdentifier
string

Méthodes

getErrors
Récupère le tableau des erreurs de transaction à partir du contexte, ou un tableau vide s’il n’y en a aucune.Un tableau d’objets d’erreur provenant du contexte de transaction.
resendCode
Promise<void>
Demande l’envoi d’un nouveau code One-Time Password (OTP) au courriel de l’utilisateur.
Example
import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge';

const emailOTPChallenge = new EmailOTPChallenge();
emailOTPChallenge.resendCode();
resendManager
Fonctionnalité utilitaireFournit la fonctionnalité de renvoi avec gestion du délai d’attente pour cet écran.Objet ResendControl avec la méthode startResend.
Example
import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge';

const emailOTPChallenge = new EmailOTPChallenge();
const { startResend } = emailOTPChallenge.resendManager({
  timeoutSeconds: 15,
  onStatusChange: (remainingSeconds, isDisabled) => {
    console.log(`Resend available in ${remainingSeconds}s, disabled: ${isDisabled}`);
  },
  onTimeout: () => {
    console.log('Resend is now available');
  }
});

// Appeler startResend lorsque l'utilisateur clique sur le bouton de renvoi
startResend();
submitCode
Promise<void>
Soumet le code OTP saisi par l’utilisateur.
Example
import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge';

const emailOTPChallenge = new EmailOTPChallenge();
emailOTPChallenge.submitCode({
  code: '123456',
});