MultiFactorError interface

사용자가 성공적으로 로그인하기 위해 두 번째 요소를 제공해야 할 때 발생하는 오류입니다.

이 오류의 오류 코드는 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);