mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[MNT-21636] Use URLTree for redirect (#6691)
* use URLTree for redirect * use always urltree * fix e2e * fix
This commit is contained in:
@@ -75,12 +75,12 @@ export abstract class AuthGuardBase implements CanActivate, CanActivateChild {
|
||||
return this.canActivate(route, state);
|
||||
}
|
||||
|
||||
protected async redirectSSOSuccessURL(): Promise<boolean> {
|
||||
protected async redirectSSOSuccessURL(): Promise<boolean | UrlTree> {
|
||||
const redirectFragment = this.storageService.getItem('loginFragment');
|
||||
|
||||
if (redirectFragment && this.getLoginRoute() !== redirectFragment) {
|
||||
this.storageService.removeItem('loginFragment');
|
||||
return this.navigate(redirectFragment);
|
||||
return this.router.parseUrl(redirectFragment);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -90,7 +90,7 @@ export abstract class AuthGuardBase implements CanActivate, CanActivateChild {
|
||||
return !!this.storageService.getItem('loginFragment');
|
||||
}
|
||||
|
||||
protected async redirectToUrl(url: string): Promise<boolean> {
|
||||
protected async redirectToUrl(url: string): Promise<boolean | UrlTree> {
|
||||
let urlToRedirect = `/${this.getLoginRoute()}`;
|
||||
|
||||
if (!this.authenticationService.isOauth()) {
|
||||
@@ -110,9 +110,9 @@ export abstract class AuthGuardBase implements CanActivate, CanActivateChild {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected navigate(url: string): Promise<boolean> {
|
||||
protected navigate(url: string): UrlTree {
|
||||
this.dialog.closeAll();
|
||||
return this.router.navigateByUrl(url);
|
||||
return this.router.parseUrl(url);
|
||||
}
|
||||
|
||||
protected getOauthConfig(): OauthConfigModel {
|
||||
|
Reference in New Issue
Block a user