Using the following Firebase email authentication code, how did you know if authentication was successful?
firebase.auth().signInWithEmailAndPassword(email, password).catch(function(error) {
var errorCode = error.code;
var errorMessage = error.message;
if (errorCode === 'auth/wrong-password') {
alert('Wrong password.');
} else {
alert(errorMessage);
}
console.log(error);
});
I understand that it is easy to see if authentication was unsuccessful, however, how do I know if a user was able to log in with his credentials? There does not seem to be a callback for a "successful" login. I currently have a login form and want to switch to a successful login.
source
share