MultiFactorError interface

Kullanıcının başarıyla oturum açmak için ikinci bir faktör sağlaması gerektiğinde oluşan hata.

Bu hatanın hata kodu auth/multi-factor-auth-required .

İmza:

export interface MultiFactorError extends AuthError 

Uzatır: AuthError

Özellikler

Mülk Tip Tanım
özelVeriler Kimlik Doğrulama Hatası ['customData'] & { salt okunur OperationType: (typeof OperationTypeMap )[keyof typeof OperationTypeMap ]; } MultiFactorError ile ilgili ayrıntılar.

MultiFactorError.customData

MultiFactorError ile ilgili ayrıntılar.

İmza:

readonly customData: AuthError['customData'] & {
        readonly operationType: (typeof OperationTypeMap)[keyof typeof OperationTypeMap];
    };

Örnek

let resolver;
let multiFactorHints;

signInWithEmailAndPassword(auth, email, password)
    .then((result) => {
      // User signed in. No 2nd factor challenge is needed.
    })
    .catch((error) => {
      if (error.code == 'auth/multi-factor-auth-required') {
        resolver = getMultiFactorResolver(auth, error);
        multiFactorHints = resolver.hints;
      } else {
        // Handle other errors.
      }
    });

// Obtain a multiFactorAssertion by verifying the second factor.

const userCredential = await resolver.resolveSignIn(multiFactorAssertion);