Ajout de param sur le redirect vers la page
de login
This commit is contained in:
@@ -41,6 +41,6 @@ export class AppComponent implements OnInit {
|
||||
logout() {
|
||||
this.authenticationService.logout();
|
||||
this.showMenu = !this.showMenu;
|
||||
this.router.navigate(["/login"]);
|
||||
this.router.navigate(["/login"], { skipLocationChange: true });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,10 @@ export class AuthGuardService implements CanActivate {
|
||||
}
|
||||
|
||||
// not logged in so redirect to login page with the return url
|
||||
this.router.navigate(["/login"], { queryParams: { returnUrl: state.url } });
|
||||
this.router.navigate(["/login"], {
|
||||
skipLocationChange: true,
|
||||
queryParams: { returnUrl: state.url }
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user