Redirect after login

.then(() => this.router.navigate(['/dashboard']))
onLogin(): void {
  if (this.loginForm) {
    const email = this.loginForm.get('formEmail')?.value;
    const password = this.loginForm.get('formPassword')?.value;
    this.auth
      .signInWithEmailAndPassword(email as string, password as string)
      .then(() => this.router.navigate(['/']));
  }
}
Was this page helpful?