jofftiquez
jofftiquez

Reputation: 7708

Firebase auth reauthenticate is not a function

I am getting a :

Uncaught TypeError: user.reauthenticate is not a function

with this code below.

var user = firebase.auth().currentUser;
var credentials = firebase.auth.EmailAuthProvider.credential(user.email,'foo');

console.log(user) // the currentUser object
console.log(user.reauthenticate) // undefined    

user.reauthenticate(credentials)
    .then(() => {
        // Do something
    }, err => console.log(error));

I just followed this guide and this accepted answer by Frank van Puffelen.

Upvotes: 1

Views: 1901

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598740

firebaser here

We made a breaking change in the 4.0 version of the Firebase Web SDK. From the release notes:

BREAKING: firebase.User.prototype.reauthenticate has been removed in favor of firebase.User.prototype.reauthenticateWithCredential.

As far as I can tell the reauthenticateWithCredentialis a drop-in replacement for the old method.

Upvotes: 2

Related Questions