Add login auth
This commit is contained in:
parent
32540659d5
commit
e5f5b7014b
@ -33,17 +33,17 @@ export class AppComponent {
|
||||
(event as NavigationEnd).url === '/login' ||
|
||||
(event as NavigationEnd).url === '/register'
|
||||
);
|
||||
// if (this.tokenStorage.getToken()) {
|
||||
// this.isLoggedIn = true;
|
||||
// } else {
|
||||
// this.isLoggedIn = false;
|
||||
// }
|
||||
// if (
|
||||
// this.isLoggedIn === false &&
|
||||
// (event as NavigationEnd).url != '/register'
|
||||
// ) {
|
||||
// this.router.navigate(['/login']);
|
||||
// }
|
||||
if (this.tokenStorage.getToken()) {
|
||||
this.isLoggedIn = true;
|
||||
} else {
|
||||
this.isLoggedIn = false;
|
||||
}
|
||||
if (
|
||||
this.isLoggedIn === false &&
|
||||
(event as NavigationEnd).url != '/register'
|
||||
) {
|
||||
this.router.navigate(['/login']);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user