From a2bcdfbea9104a57a51a852bfc1cda005f84edca Mon Sep 17 00:00:00 2001 From: lotte Date: Thu, 20 Sep 2018 15:24:16 +0200 Subject: [PATCH] disabled reloads --- src/app/core/auth/auth.service.ts | 7 ++++--- src/app/core/auth/server-auth.service.ts | 2 -- src/app/shared/auth-nav-menu/auth-nav-menu.component.ts | 8 ++------ 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/app/core/auth/auth.service.ts b/src/app/core/auth/auth.service.ts index f69dd2b58f..a7a1237e1c 100644 --- a/src/app/core/auth/auth.service.ts +++ b/src/app/core/auth/auth.service.ts @@ -245,7 +245,6 @@ export class AuthService { public getToken(): AuthTokenInfo { let token: AuthTokenInfo; this.store.select(getAuthenticationToken) - .first() .subscribe((authTokenInfo: AuthTokenInfo) => { // Retrieve authentication token info and check if is valid token = authTokenInfo || null; @@ -349,10 +348,12 @@ export class AuthService { this.router.navigated = false; const url = decodeURIComponent(redirectUrl); this.router.navigateByUrl(url); - this._window.nativeWindow.location.href = url; + /* TODO Reenable hard redirect when REST API can handle x-forwarded-for */ + // this._window.nativeWindow.location.href = url; } else { this.router.navigate(['/']); - this._window.nativeWindow.location.href = '/'; + /* TODO Reenable hard redirect when REST API can handle x-forwarded-for */ + // this._window.nativeWindow.location.href = '/'; } }) diff --git a/src/app/core/auth/server-auth.service.ts b/src/app/core/auth/server-auth.service.ts index 18eba2e92d..9030443a1e 100644 --- a/src/app/core/auth/server-auth.service.ts +++ b/src/app/core/auth/server-auth.service.ts @@ -71,10 +71,8 @@ export class ServerAuthService extends AuthService { this.router.navigated = false; const url = decodeURIComponent(redirectUrl); this.router.navigateByUrl(url); - this._window.nativeWindow.location.href = url; } else { this.router.navigate(['/']); - this._window.nativeWindow.location.href = '/'; } }) diff --git a/src/app/shared/auth-nav-menu/auth-nav-menu.component.ts b/src/app/shared/auth-nav-menu/auth-nav-menu.component.ts index c657071987..f7e1b03c88 100644 --- a/src/app/shared/auth-nav-menu/auth-nav-menu.component.ts +++ b/src/app/shared/auth-nav-menu/auth-nav-menu.component.ts @@ -62,12 +62,8 @@ export class AuthNavMenuComponent implements OnInit { this.showAuth = this.store.select(routerStateSelector) .filter((router: RouterReducerState) => isNotUndefined(router) && isNotUndefined(router.state)) .map((router: RouterReducerState) => { - const url = router.state.url; - const show = !router.state.url.startsWith(LOGIN_ROUTE) && !router.state.url.startsWith(LOGOUT_ROUTE); - if (show) { - this.authService.setRedirectUrl(url); - } - return show; + return !router.state.url.startsWith(LOGIN_ROUTE) && !router.state.url.startsWith(LOGOUT_ROUTE); + }); } }