Skip to content
Permalink
Browse files

modified isLoggedIn function to check for auth token, log in page now…

… removes auth token on init
  • Loading branch information
ema14006 committed Apr 29, 2019
1 parent b99cad3 commit faeb48bc6af354c54e60352dfdd3b0358a7f1d40
Showing with 2 additions and 1 deletion.
  1. +1 −0 src/app/authentication/authentication.component.ts
  2. +1 −1 src/app/header/header.component.ts
@@ -54,6 +54,7 @@ export class AuthenticationComponent implements OnInit {
localStorage.removeItem('gen_name');
localStorage.removeItem('data_type');
localStorage.removeItem('fault_type');
localStorage.removeItem('auth_token');
}

}
@@ -25,7 +25,7 @@ export class HeaderComponent implements OnInit {
}
isLoggedIn()
{
if(this.router.url != '/' && this.router.url != '/#')
if(localStorage.getItem('auth_token'))
{
return true;
}

0 comments on commit faeb48b

Please sign in to comment.
You can’t perform that action at this time.