MultiFactorError interface

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

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

İmza:

export interface MultiFactorError extends AuthError 

Genişletir: AuthError

Özellikler

Özellik Tür Açıklama
customData AuthError['customData'] ve { Readonly actionType: (OperationTypeMap)[keyof typeof OperationTypeHarita]; } 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);