MultiFactorError interface

त्रुटि तब उत्पन्न हुई जब उपयोगकर्ता को सफलतापूर्वक साइन इन करने के लिए दूसरा कारक प्रदान करने की आवश्यकता होती है।

इस त्रुटि के लिए त्रुटि कोड auth/multi-factor-auth-required है .

हस्ताक्षर:

export interface MultiFactorError extends AuthError 

विस्तारित: AuthError

गुण

संपत्ति प्रकार विवरण
कस्टमडेटा लेखकत्रुटि ['कस्टमडेटा'] और {केवल पढ़ने के लिए ऑपरेशन प्रकार: ( ऑपरेशन टाइप मैप का प्रकार)। )[ ऑपरेशन टाइपमैप के प्रकार की कुंजी ]; } मल्टीफैक्टर एरर के बारे में विवरण।

मल्टीफैक्टर एरर.कस्टमडेटा

मल्टीफैक्टर एरर के बारे में विवरण।

हस्ताक्षर:

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