mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
disabled reloads
This commit is contained in:
@@ -245,7 +245,6 @@ export class AuthService {
|
|||||||
public getToken(): AuthTokenInfo {
|
public getToken(): AuthTokenInfo {
|
||||||
let token: AuthTokenInfo;
|
let token: AuthTokenInfo;
|
||||||
this.store.select(getAuthenticationToken)
|
this.store.select(getAuthenticationToken)
|
||||||
.first()
|
|
||||||
.subscribe((authTokenInfo: AuthTokenInfo) => {
|
.subscribe((authTokenInfo: AuthTokenInfo) => {
|
||||||
// Retrieve authentication token info and check if is valid
|
// Retrieve authentication token info and check if is valid
|
||||||
token = authTokenInfo || null;
|
token = authTokenInfo || null;
|
||||||
@@ -349,10 +348,12 @@ export class AuthService {
|
|||||||
this.router.navigated = false;
|
this.router.navigated = false;
|
||||||
const url = decodeURIComponent(redirectUrl);
|
const url = decodeURIComponent(redirectUrl);
|
||||||
this.router.navigateByUrl(url);
|
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 {
|
} else {
|
||||||
this.router.navigate(['/']);
|
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 = '/';
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@@ -71,10 +71,8 @@ export class ServerAuthService extends AuthService {
|
|||||||
this.router.navigated = false;
|
this.router.navigated = false;
|
||||||
const url = decodeURIComponent(redirectUrl);
|
const url = decodeURIComponent(redirectUrl);
|
||||||
this.router.navigateByUrl(url);
|
this.router.navigateByUrl(url);
|
||||||
this._window.nativeWindow.location.href = url;
|
|
||||||
} else {
|
} else {
|
||||||
this.router.navigate(['/']);
|
this.router.navigate(['/']);
|
||||||
this._window.nativeWindow.location.href = '/';
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@@ -62,12 +62,8 @@ export class AuthNavMenuComponent implements OnInit {
|
|||||||
this.showAuth = this.store.select(routerStateSelector)
|
this.showAuth = this.store.select(routerStateSelector)
|
||||||
.filter((router: RouterReducerState) => isNotUndefined(router) && isNotUndefined(router.state))
|
.filter((router: RouterReducerState) => isNotUndefined(router) && isNotUndefined(router.state))
|
||||||
.map((router: RouterReducerState) => {
|
.map((router: RouterReducerState) => {
|
||||||
const url = router.state.url;
|
return !router.state.url.startsWith(LOGIN_ROUTE) && !router.state.url.startsWith(LOGOUT_ROUTE);
|
||||||
const show = !router.state.url.startsWith(LOGIN_ROUTE) && !router.state.url.startsWith(LOGOUT_ROUTE);
|
|
||||||
if (show) {
|
|
||||||
this.authService.setRedirectUrl(url);
|
|
||||||
}
|
|
||||||
return show;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user