The constructor has this logic:
if (localStorage.getItem('login')) {
this.router.navigate(['dashboard']);
}
This is a security vulnerability. It should be checking the validity of the token. Also, this logic belongs on a RouteGuard, because currently the user sees the login screen briefly before being redirected.
The constructor has this logic:
This is a security vulnerability. It should be checking the validity of the token. Also, this logic belongs on a RouteGuard, because currently the user sees the login screen briefly before being redirected.