MultiFactorError interface

সফলভাবে সাইন ইন করার জন্য ব্যবহারকারীকে একটি দ্বিতীয় ফ্যাক্টর প্রদান করার প্রয়োজন হলে থ্রো করা ত্রুটি।

এই ত্রুটির জন্য ত্রুটি কোড হল auth/multi-factor-auth-required .

স্বাক্ষর:

export interface MultiFactorError extends AuthError 

প্রসারিত: AuthError

বৈশিষ্ট্য

সম্পত্তি টাইপ বর্ণনা
কাস্টম ডেটা লেখক ত্রুটি ['কাস্টমডেটা'] এবং { শুধুমাত্র পঠনযোগ্য অপারেশন টাইপ: ( অপারেশন টাইপম্যাপের প্রকার ) [ অপারেশন টাইপম্যাপের টাইপের কী ]; } 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);