Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

179
Views
Firebase multifactor auth - Error object not returning resolver

I'm trying to add MFA inside my web app following the guide https://cloud.google.com/identity-platform/docs/web/mfa.

I started with enrolling the phone number successfully with the account and now when I want to "login" again using that phone number but I can’t use the number to get a code.

Check the code:

//I have imported my firebase services inside services/firebase.js
import { auth, signInWithEmailAndPassword, PhoneMultiFactorGenerator } from '@/services/firebase';
methods: {
  //On login button click - this method is called
  login: async function (event) {
    var self = this;
    await signInWithEmailAndPassword(auth, self.user_email, self.user_password)
    .then(()=> {
      ...
      //I am setting the user here, and giving access based on the role of the user
    }
    .catch((error) => {
          console.log('Error:', error);
          //Gives: Error: FirebaseError: Firebase: Error (auth/multi-factor-auth-required).
          if (error.code == 'auth/multi-factor-auth-required') {
            self.resolver = error.resolver;
            //assigning to my data field so I can use this later with my phone number verification
            console.log(error.resolver);
            //UNDEFINED
            ...
          } else {
           ...
          }
        });
  }
}

In the code above the error object does not have a resolver, so "error.resolver" is undefined which I need in a later stage. (FYI:- I am not using the Multi-Tenancy option)

UPDATE: Solved

The docs (https://cloud.google.com/identity-platform/docs/web/mfa) are outdated and functions are changed now.

Now the resolver doesn't come from the error object, we just need to call the resolver using a firebase function

getMultiFactorResolver

resolver = getMultiFactorResolver(auth, error);

Have a look here and you will undestand everything: https://firebase.google.com/docs/reference/js/auth.multifactorresolver#example_2

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!