#1393 remove old redirect code (#1394)

This commit is contained in:
Mario Romano
2017-01-04 22:29:01 +00:00
committed by Denys Vuika
parent a35c2f7c04
commit f89fe8e50a
2 changed files with 3 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
<!-- Always shows a header, even in smaller screens. --> <!-- Always shows a header, even in smaller screens. -->
<div mdl class="mdl-layout mdl-js-layout mdl-layout--fixed-header"> <div mdl class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header main_header_adf" [ngClass]="{hide: isLoginPage()}"> <header class="mdl-layout__header main_header_adf" [ngClass]="{hide: isAPageWithHeaderBar()}">
<div class="mdl-button-padding mdl-layout__header-row"> <div class="mdl-button-padding mdl-layout__header-row">
<!-- User Info --> <!-- User Info -->

View File

@@ -64,12 +64,12 @@ export class AppComponent {
} }
redirectToLoginPageIfNotLoggedIn(): void { redirectToLoginPageIfNotLoggedIn(): void {
if (!this.isLoginPage() && !this.authService.isLoggedIn()) { if (!this.authService.isLoggedIn()) {
this.router.navigate(['/login']); this.router.navigate(['/login']);
} }
} }
isLoginPage(): boolean { isAPageWithHeaderBar(): boolean {
return location.pathname === '/login' || location.pathname === '/settings'; return location.pathname === '/login' || location.pathname === '/settings';
} }