var user = firebase.auth().currentUser;
var credential;
// Prompt the user to re-provide their sign-in credentials
user.reauthenticate(credential).then(function() {
With the v3 Firebase client, how should I create this credential object for Google auth provider (Not email & Password).
How to do it with email and password was answered here: Email&Password.
I've tried var credential = firebase.auth.GoogleAuthProvider.credential(); but according to the docs it's needs an "Google Id Token" which I have no idea how to get.
You can create an AuthCredential by using firebase.auth.EmailAuthProvider.credential.
Then you can reauthenticate with firebase.User.reauthenticateWithCredential.
var user = firebase.auth().currentUser;
var credential = firebase.auth.EmailAuthProvider.credential(
user.email,
'yourpassword'
);
user.reauthenticateWithCredential(credential);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With