[MNT-21636] Refactor redirect URL (#6658)

* refactor redirect URL

* fix unit test
This commit is contained in:
Eugenio Romano
2021-02-10 23:36:22 +00:00
committed by GitHub
parent ad70837b3d
commit 205c324f4e
8 changed files with 109 additions and 108 deletions

View File

@@ -61,7 +61,7 @@ export class AuthGuard extends AuthGuardBase {
private ticketChangeRedirect(event: StorageEvent) {
if (!event.newValue) {
this.redirectToUrl(this.router.url);
this.navigate(this.router.url);
} else {
window.location.reload();
}
@@ -69,9 +69,9 @@ export class AuthGuard extends AuthGuardBase {
async checkLogin(_: ActivatedRouteSnapshot, redirectUrl: string): Promise<boolean> {
if (this.authenticationService.isLoggedIn() || this.withCredentials) {
return true;
}
this.redirectToUrl( redirectUrl);
return false;
return this.redirectToUrl( redirectUrl);
}
}