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

348
Views
Firebase v8 - how to access EmailAuthProvider when `firebase.default.auth` is undefined

I am using Firebase authentication with AngularFire2 on an Ionic-Angular project. I need to be able to reauthenticate my users when needed, and it seems like the only way to do so is by obtaining the user's credentials, which can only be obtained through firebase.auth.EmailAuthProvider, an object which isn't part of AngularFire, but only of firebase itself.

I am using firebase v8 for this, on which the EmailAuthProvider object should be found in firebase.default.auth.EmailAuthProvider. However, I get that firebase.default.auth is undefined, and am therefore unable to access EmailAuthProvider. The only solution I've found is to revert back to firebase v7, in which the latter can be successfully accessed through firebase.auth.EmailAuthProvider. I cannot upgrade yet to firebase v9 for other compatibility issues, nor want to keep v7 as it gives me loads of high and medium vulnerabilities.

EDIT

I obtain the credentials in this manner:

import * as firebase from "firebase/app";

...

firebase.default.auth.EmailAuthProvider.credential(email, password)

And I get the following error:

Uncaught TypeError: Cannot read properties of undefined (reading 'EmailAuthProvider')

My package.json file has "@angular/fire": "^6.1.5" and "firebase": "^8.10.0"

TLDR

In Firebase v8, how to access EmailAuthProvider, or more generally, how to reauthenticate a user?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try changing your imports as shown below:

import firebase from "firebase/app"; 
import "firebase/auth" // <-- make sure you have auth imported

Then access EmailAuthProvider like this:

firebase.auth.EmailAuthProvider.credential(email, password)
about 4 years ago · Juan Pablo Isaza Report
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!