MultiFactorError interface

ユーザーが正常にサインインするために 2 番目の要素を指定する必要がある場合にスローされるエラー。

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

サイン:

export interface MultiFactorError extends AuthError 

拡張: AuthError

プロパティ

財産タイプ説明
カスタムデータ認証エラー['customData'] & { 読み取り専用 OperationType: ( OperationTypeMapのタイプ)[ 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);