Passer au contenu principal
Classe qui implémente la fonctionnalité de l’écran mfa-email-challenge Cet écran s’affiche lorsqu’un utilisateur doit vérifier son courriel dans le cadre de l’authentification multifacteur (AMF, MFA)
Example
import MfaEmailChallenge from '@auth0/auth0-acul-js/mfa-email-challenge';

const mfaEmailChallenge = new MfaEmailChallenge();
await mfaEmailChallenge.continue({
  code: '123456',
  rememberDevice: true
});

Constructeurs

MfaEmailChallenge
Constructor
Crée une instance du gestionnaire d’écrans MfaEmailChallenge

Propriétés

branding
client
organization
prompt
screen
tenant
transaction
untrustedData
user
screenIdentifier
string

Méthodes

continue
Promise<void>
Poursuit le défi par courriel en utilisant le code fourni
Example
import MfaEmailChallenge from '@auth0/auth0-acul-js/mfa-email-challenge';

const mfaEmailChallenge = new MfaEmailChallenge();
await mfaEmailChallenge.continue({
  code: '123456',
  rememberDevice: true
});
getErrors
Récupère le tableau d’erreurs de la transaction à partir du contexte, ou un tableau vide si aucune n’existe.Un tableau d’objets d’erreur provenant du contexte de la transaction.
pickEmail
Promise<void>
Soumet l’action pour choisir une autre configuration de courriel, si disponible.
Example
import MfaEmailChallenge from '@auth0/auth0-acul-js/mfa-email-challenge';

const mfaEmailChallenge = new MfaEmailChallenge();
await mfaEmailChallenge.pickEmail();
resendCode
Promise<void>
Renvoie le code par courriel
Example
import MfaEmailChallenge from '@auth0/auth0-acul-js/mfa-email-challenge';

const mfaEmailChallenge = new MfaEmailChallenge();
await mfaEmailChallenge.resendCode();
resendManager
Fonction utilitaireFournit la fonctionnalité de renvoi avec gestion du délai d’attente pour cet écranObjet ResendControl avec la méthode startResend
Example
import MfaEmailChallenge from '@auth0/auth0-acul-js/mfa-email-challenge';

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

// Call startResend when user clicks resend button
startResend();
tryAnotherMethod
Promise<void>
Permet à l’utilisateur d’essayer une autre méthode d’AMF (MFA)
Example
import MfaEmailChallenge from '@auth0/auth0-acul-js/mfa-email-challenge';

const mfaEmailChallenge = new MfaEmailChallenge();
await mfaEmailChallenge.tryAnotherMethod();