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

130
Views
Missing functions in Firebase auth V9

I'm facing a horrible issue with firebase auth. At this point, I'm completely and utterly stumped.

Whenever I try to call user.getIdTokenResult(), I get an error TypeError: undefined is not an object (evaluating 'n.getIdToken').

The user is defined. I log into the console before the function runs, and it always prints out a user. Plus, I'm calling the function in onAuthStateChanged.

What's even more strange is that it works perfectly on localhost, but once I push to production or even tunnel the domain, it stops working completely.

I have no idea what's going on.

It looks like this fellow faced the same issue: How to use the getIdToken() auth method in firebase version 9?. No solution, though.

It also looks like it only fails on Safari and iOS.

Code I'm running:

 auth.onAuthStateChanged(async (user) => {
    if (user) {
        console.log('user', user); // prints out a user object
        // Fails here
        const idTokenResult = await user.getIdTokenResult();
...
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!