diff --git a/src/app/auth/auth.guard.ts b/src/app/auth/auth.guard.ts index 6779118..d39df8f 100644 --- a/src/app/auth/auth.guard.ts +++ b/src/app/auth/auth.guard.ts @@ -29,7 +29,7 @@ export class AuthGuard implements CanActivate { return this.authService.getAuth().then(response => { return true; }).catch(function (error) { - return that.router.navigateByUrl(that.router.parseUrl('/unavailable?target=' + next.url), { skipLocationChange: true }); + return that.router.navigateByUrl(that.router.parseUrl('/unavailable?target=' + encodeURIComponent(state.url)), { skipLocationChange: true }); }); } } @@ -74,7 +74,7 @@ export class AuthenticatedGuard implements CanActivate { return true; }).catch(function (error) { - return that.router.navigateByUrl(that.router.parseUrl('/unavailable?target=' + next.url), { skipLocationChange: true }); + return that.router.navigateByUrl(that.router.parseUrl('/unavailable?target=' + encodeURIComponent(state.url)), { skipLocationChange: true }); }); } } @@ -94,7 +94,7 @@ export class AnonymousGuard implements CanActivate { } return true; }).catch(function (error) { - return that.router.navigateByUrl(that.router.parseUrl('/unavailable?target=' + next.url), { replaceUrl: true }); + return that.router.navigateByUrl(that.router.parseUrl('/unavailable?target=' + encodeURIComponent(state.url)), { replaceUrl: true }); }); }