diff --git a/frontend/src/app/app.component.ts b/frontend/src/app/app.component.ts index 2cb0777..e3465f6 100644 --- a/frontend/src/app/app.component.ts +++ b/frontend/src/app/app.component.ts @@ -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']); + } }); } }