I'm using below function to login an existing user with firebase authentication, but for some reason nothing happens. I don't get an error or confirmation. I can paste the same code into my DOM console and get logged in, but for some reason nothing when I call this function from my JS file. I've confirmed that the input's for email/password are right, and believe this may be an Async issue, but not sure how to go upon resolving it.
$('.user-login').on("submit", function () {
var email = $('.email-login').val().trim();
var password = $('.password-login').val().trim();
console.log(email + ' ' + password)
firebase.auth().signInWithEmailAndPassword(email, password)
.then(function () {
console.log('logged in')
})
.catch(function (error) {
console.log(error);
});
})
signInWithEmailAndPasswordwhen the user submits the email+password form. What's the problem after that? Does either of theconsole.log()statements get printed?