mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-12 04:23:04 +00:00
Fixed an issue with redirect url
This commit is contained in:
@@ -54,13 +54,13 @@ export class AuthService {
|
||||
|
||||
// If current route is different from the one setted in authentication guard
|
||||
// and is not the login route, clear redirect url and messages
|
||||
const routeUrlObs = this.store.select(routerStateSelector)
|
||||
const routeUrl$ = this.store.select(routerStateSelector)
|
||||
.filter((routerState: RouterReducerState) => isNotUndefined(routerState) && isNotUndefined(routerState.state))
|
||||
.filter((routerState: RouterReducerState) => !this.isLoginRoute(routerState.state.url))
|
||||
.map((routerState: RouterReducerState) => routerState.state.url);
|
||||
const redirectUrlObs = this.getRedirectUrl();
|
||||
routeUrlObs.pipe(
|
||||
withLatestFrom(redirectUrlObs),
|
||||
const redirectUrl$ = this.store.select(getRedirectUrl).distinctUntilChanged();
|
||||
routeUrl$.pipe(
|
||||
withLatestFrom(redirectUrl$),
|
||||
map(([routeUrl, redirectUrl]) => [routeUrl, redirectUrl])
|
||||
).filter(([routeUrl, redirectUrl]) => isNotEmpty(redirectUrl) && (routeUrl !== redirectUrl))
|
||||
.subscribe(() => {
|
||||
@@ -329,7 +329,6 @@ export class AuthService {
|
||||
this.getRedirectUrl()
|
||||
.first()
|
||||
.subscribe((redirectUrl) => {
|
||||
console.log('Browser');
|
||||
if (isNotEmpty(redirectUrl)) {
|
||||
this.clearRedirectUrl();
|
||||
|
||||
|
@@ -58,7 +58,6 @@ export class ServerAuthService extends AuthService {
|
||||
this.getRedirectUrl()
|
||||
.first()
|
||||
.subscribe((redirectUrl) => {
|
||||
console.log('server side');
|
||||
if (isNotEmpty(redirectUrl)) {
|
||||
// override the route reuse strategy
|
||||
this.router.routeReuseStrategy.shouldReuseRoute = () => {
|
||||
|
@@ -14,7 +14,6 @@ export class ServerCookieService extends CookieService implements ICookieService
|
||||
}
|
||||
|
||||
public get(name: string): any {
|
||||
console.log(this.req.connection.remoteAddress);
|
||||
try {
|
||||
return JSON.parse(this.req.cookies[name])
|
||||
} catch (err) {
|
||||
|
Reference in New Issue
Block a user