The error thrown when the user needs to provide a second factor to sign in successfully. The error code for this error is auth/multi-factor-auth-required. This error provides a firebase.auth.MultiFactorResolver object, which you can use to get the second sign-in factor from the user.

example
firebase.auth().signInWithEmailAndPassword()
    .then(function(result) {
      // User signed in. No 2nd factor challenge is needed.
    })
    .catch(function(error) {
      if (error.code == 'auth/multi-factor-auth-required') {
        var resolver = error.resolver;
        var multiFactorHints = resolver.hints;
      } else {
        // Handle other errors.
      }
    });

resolver.resolveSignIn(multiFactorAssertion)
    .then(function(userCredential) {
      // User signed in.
    });

Index

Properties

code

code: string

Unique error code.

Optional credential

credential: AuthCredential

The firebase.auth.AuthCredential that can be used to resolve the error.

Optional email

email: string

The email of the user's account used for sign-in/linking.

message

message: string

Complete error message.

name

name: string

Optional phoneNumber

phoneNumber: string

The phone number of the user's account used for sign-in/linking.

resolver

The multi-factor resolver to complete second factor sign-in.

Optional tenantId

tenantId: string

The tenant ID being used for sign-in/linking. If you use firebase.auth.Auth.signInWithRedirect to sign in, you have to set the tenant ID on Auth instanace again as the tenant ID is not persisted after redirection.