MultiFactorError interface

يظهر الخطأ عندما يحتاج المستخدم إلى تقديم عامل ثانٍ لتسجيل الدخول بنجاح.

رمز الخطأ لهذا الخطأ هو auth/multi-factor-auth-required.

Signature:

export interface MultiFactorError extends AuthError 

للتوسيع: AuthError

أماكن إقامة

الموقع النوع الوصف
customData AuthError['customData'] & { readonly operationType: (typeof OperationTypeMap)[keyof typeof OperationTypeMap]; } تفاصيل حول خطأ متعدد العوامل.

MultiFactorError.customData

تفاصيل حول خطأ متعدد العوامل.

Signature:

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

مثال

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);