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