Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

349
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda