loginWithCredentials() { this.fireauth.auth.signInWithEmailAndPassword(this.email, this.password) .then(res => { if (res.user) { console.log(res.user); this.router.navigateByUrl('/home'); } }) .catch(err => { console.log(`login failed ${err}`); this.error = err.message; }); }