Skip to content
Snippets Groups Projects
Verified Commit fed6f4e1 authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #13670 TIME 1:30 Save query string in cachedUrl for scanToMaarch

parent a5350437
No related branches found
No related tags found
No related merge requests found
......@@ -77,7 +77,7 @@ export class LoginComponent implements OnInit {
this.authService.saveTokens(data.headers.get('Token'), data.headers.get('Refresh-Token'));
this.authService.setUser({});
if (this.authService.getCachedUrl()) {
this.router.navigate([this.authService.getCachedUrl()]);
this.router.navigateByUrl(this.authService.getCachedUrl());
this.authService.cleanCachedUrl();
} else if (!this.functionsService.empty(this.authService.getUrl(JSON.parse(atob(data.headers.get('Token').split('.')[1])).user.id))) {
this.router.navigate([this.authService.getUrl(JSON.parse(atob(data.headers.get('Token').split('.')[1])).user.id)]);
......
......@@ -26,6 +26,7 @@ export class AppGuard implements CanActivate {
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<any> {
console.log('guard : ' + route.url.join('/'));
console.log(state.url.replace(/^\//g, ""));
this.headerService.resetSideNavSelection();
......@@ -120,7 +121,7 @@ export class AppGuard implements CanActivate {
this.authService.setUrl(route.url.join('/'));
return tokenInfo;
} else {
this.authService.setCachedUrl(route.url.join('/'));
this.authService.setCachedUrl(state.url.replace(/^\//g, ""));
console.log('Aucun token trouvé ! Redirection sur login ...');
this.authService.logout(false);
return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment