MultiFactorError interface

このエラーは、ユーザーがログインするために 2 つ目の要素を入力する必要がある場合にスローされます。

このエラーのエラーコードは auth/multi-factor-auth-required です。

署名:

export interface MultiFactorError extends AuthError 

拡張: AuthError

プロパティ

プロパティ 説明
customData AuthError['customData'] および{ readonly operationType: (typeof 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);