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

154
Views
How to reauthorize a user in Firebase?

Environment

  • Firebase JavaScript SDK v8

Question

How can I re-authorize an already-logged-in user with their password? What I want to do is like below:

const password = "some-password"
firebase.reAuthorizeUser(password)
  .then(() => console.log("ok"))
  .catch(() => console.log("ng"))

Thank you in advance.

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

0

You are looking for reauthenticateWithCredential method.

const user = firebase.auth().currentUser;

// TODO(you): prompt the user to re-provide their sign-in credentials
const credential = promptForCredentials();

user.reauthenticateWithCredential(credential).then(() => {
  // User re-authenticated.
}).catch((error) => {
  // An error ocurred
  // ...
});

Checkout reauthenticate a user in the documentation.

about 4 years ago · Juan Pablo Isaza Report

0

SDK v9

import {getAuth, reauthenticateWithCredential, EmailAuthProvider} from "firebase/auth";

  const reauthenticate = async () => {
    try {
        const auth = getAuth();
        const user = auth.currentUser;
        const credential = await EmailAuthProvider.credential(
            email,
            password
        );
        await reauthenticateWithCredential(user, credential);
        return true
    } catch (e) {
        return null
    }
}
about 4 years ago · Juan Pablo Isaza Report

0

const credential = promptForCredentials();

this is giving me error

cant find variable: promptForCredentials.

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!