MultiFactorError interface

เกิดข้อผิดพลาดเมื่อผู้ใช้ต้องระบุปัจจัยที่ 2 เพื่อให้ลงชื่อเข้าใช้ได้สำเร็จ

รหัสข้อผิดพลาดสำหรับข้อผิดพลาดนี้คือ auth/multi-factor-auth-required

ลายเซ็น:

export interface MultiFactorError extends AuthError 

ขยาย: AuthError

พร็อพเพอร์ตี้

พร็อพเพอร์ตี้ ประเภท คำอธิบาย
customData AuthError['customData'] และ { ประเภทการดำเนินการแบบอ่านอย่างเดียว: (ประเภท OperationTypeMap)[keyof typeof OperationTypeMap]; } รายละเอียดเกี่ยวกับ MultiFactorError

MultiFactorError.customData

รายละเอียดเกี่ยวกับ MultiFactorError

ลายเซ็น:

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