The error thrown when the user needs to provide a second factor to sign insuccessfully.The error code for this error isauth/multi-factor-auth-required.This error provides afirebase.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
Unique error code.
Optional credential
Inherited fromAuthError.credential
Thefirebase.auth.AuthCredential that can be used to resolve theerror.
Optional email
The email of the user's account used for sign-in/linking.
message
Complete error message.
name
Optional phoneNumber
Inherited fromAuthError.phoneNumber
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
Inherited fromAuthError.tenantId
The tenant ID being used for sign-in/linking. If you usefirebase.auth.Auth.signInWithRedirect to sign in, you have toset the tenant ID on Auth instanace again as the tenant ID is notpersisted after redirection.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-07-27 UTC.