[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

@@ -38,13 +38,11 @@ export class AuthGuardEcm extends AuthGuardBase {
super(authenticationService, router, appConfigService, dialog, storageService);
}
checkLogin(_: ActivatedRouteSnapshot, redirectUrl: string): boolean {
async checkLogin(_: ActivatedRouteSnapshot, redirectUrl: string): Promise<boolean> {
if (this.authenticationService.isEcmLoggedIn() || this.withCredentials) {
return true;
}
this.redirectToUrl(redirectUrl);
return false;
return this.redirectToUrl(redirectUrl);
}
}