irebase.auth().signInWithEmailAndPassword(email, password).then(function(user) {
// user signed in
}).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);
});
reference : https://stackoverflow.com/questions/39958467/firebase-authentication-javascript-get-success