Représente l’écran de défi One‑Time Password (OTP) par courriel.
Example
Copier
import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge';const emailOTPChallenge = new EmailOTPChallenge();emailOTPChallenge.submitCode({ code: '123456',});
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.
Demande l’envoi d’un nouveau code One-Time Password (OTP) au courriel de l’utilisateur.
Example
Copier
import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge';const emailOTPChallenge = new EmailOTPChallenge();emailOTPChallenge.resendCode();
Fonctionnalité utilitaireFournit la fonctionnalité de renvoi avec gestion du délai d’attente pour cet écran.Objet ResendControl avec la méthode startResend.
Example
Copier
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 renvoistartResend();
import EmailOTPChallenge from '@auth0/auth0-acul-js/email-otp-challenge';const emailOTPChallenge = new EmailOTPChallenge();emailOTPChallenge.submitCode({ code: '123456',});