mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
Override the redirectTo with the loginFragment (#6239)
* Override the redirectTo with the loginFragment * Add check
This commit is contained in:
@@ -65,7 +65,10 @@ export abstract class AuthGuardBase implements CanActivate, CanActivateChild {
|
|||||||
if (this.authenticationService.isEcmLoggedIn() || this.withCredentials) {
|
if (this.authenticationService.isEcmLoggedIn() || this.withCredentials) {
|
||||||
if (redirectFragment) {
|
if (redirectFragment) {
|
||||||
this.storageService.removeItem('loginFragment');
|
this.storageService.removeItem('loginFragment');
|
||||||
return this.router.createUrlTree([redirectFragment]);
|
const routeRedirectTo = route.routeConfig.children.filter( (routeTo) => routeTo.path === '' );
|
||||||
|
if (routeRedirectTo?.length > 0) {
|
||||||
|
routeRedirectTo[0].redirectTo = redirectFragment;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user