My code is throwing error Uncaught TypeError: _baseUrl.resetPassword is not a function when I am trying to invoke this function.
Following is how I have configured firebase object
var firebaseConfig = {
apiKey: "my api key",
authDomain: "my-domain.firebaseapp.com",
databaseURL: "https://collection-name.firebaseio.com",
projectId: "my-project-id-1111",
storageBucket: "my-storage-bucket.appspot.com",
messagingSenderId: "XXXXXXXXXX",
appId: "1:XXXXXXXXX:web:XXXXXXXXXX"
};
// Initialize Firebase
var _firebase = firebase.initializeApp(firebaseConfig);
var _baseUrl = _firebase.database().ref("web/data");
var _baseAuth = _firebase.auth();
function resetPassword(userEmail) {
_baseUrl.resetPassword({
email: userEmail
}, function(error) {
console.log(error);
if (error === null) {
return false;
} else {
return error;
}
});
}
when I call the resetPassowrd function it throws an error.
Uncaught TypeError: _baseUrl.resetPassword is not a function
I have checked through debugging that I am receiving "_baseUrl" in my function but it does not have a method resetPassword
Please help and Thanks in advance
I have used this function to reset the password and it is working fine.