I am working with java-script
fire-base
in my app.
I am able to createUserWithEmailAndPassword
successfully in app. Also it is showing that data inside Fire-base Console
.
Here is snippet.
firebase.auth().createUserWithEmailAndPassword("[email protected]", "*******").catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
console.log("Eroor Msg" + errorMessage);
// ...
});
Then I have gone through firebase.auth().signInWithEmailAndPassword
.
With above method I am not be able to get any success event or message to log
. Even it is not throwing any error
.
Here is snippet.
firebase.auth().signInWithEmailAndPassword("[email protected]", "*****")
.catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
if (errorCode === 'auth/wrong-password') {
alert('Wrong password.');
} else {
alert(errorMessage);
}
console.log(error);
});
My question is how to get success event in this method signInWithEmailAndPassword
?
Any help will be greatly appreciated.
Just check the below code:
firebase.auth().signInWithEmailAndPassword("[email protected]", "******")
.then(function(firebaseUser) {
// Success
})
.catch(function(error) {
// Error Handling
});
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