I am writing my angular 5+ app and using AuthGuardService
what I am doing is that I am redirecting from another php
application which send me form data in query string
http://localhost:44200/#/users/save?first_name=John&last_name=Doe
the AuthGuardService
properly redirect user to login if he is not logged in with following code
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot){
if(localStorage.getItem('crmUser')){
return true;
}
this.router.navigate(['/login'], { queryParams: {returnUrl: state.url},queryParamsHandling: 'merge' });
return false;
}
But after login I can redirect to return url if it has no query string, I want to redirect user to same page with all query string.
Please guide me how to handle it.