Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

354
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda