Here is a method that I am having trouble with:
async signinUser(email: string, password: string) {
return firebase.auth().signInWithEmailAndPassword(email, password)
.then(
response => {
console.log(response);
return firebase.auth().currentUser.getIdToken();
}
)
.then(
(token: string) => {
this.token = token;
return true;
}
)
.catch(
error => {
console.log(error);
return false;
}
);
}
This method gets called from a component in the following way:
onSignin(form: NgForm) {
const email = form.value.email;
const password = form.value.password;
this.authService.signinUser(email, password)
.then(
(result: boolean) => {
console.log(result);
if (result) {
this.router.navigateByUrl(this.returnUrl);
}
}
);
}
The component method is invoked when submitting a form.
I'm facing an issue where the promises are not executing and no logs are showing up. Can someone assist me with resolving this problem?
Thank you!