mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-30 18:15:11 +00:00
[MNT-21636] - added redirection when SSO is enabled for external link (#6099)
Co-authored-by: Vito Albano <vitoalbano@vitoalbano-mbp-0120.local>
This commit is contained in:
parent
c57253ff54
commit
14c2408c69
@ -24,6 +24,7 @@ import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { AuthGuardBase } from './auth-guard-base';
|
||||
import { Observable } from 'rxjs';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { StorageService } from './storage.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@ -33,12 +34,18 @@ export class AuthGuardEcm extends AuthGuardBase {
|
||||
constructor(authenticationService: AuthenticationService,
|
||||
router: Router,
|
||||
appConfigService: AppConfigService,
|
||||
dialog: MatDialog) {
|
||||
dialog: MatDialog,
|
||||
private storageService: StorageService) {
|
||||
super(authenticationService, router, appConfigService, dialog);
|
||||
}
|
||||
|
||||
checkLogin(_: ActivatedRouteSnapshot, redirectUrl: string): Observable<boolean> | Promise<boolean> | boolean {
|
||||
const redirectFragment = this.storageService.getItem('loginFragment');
|
||||
if (this.authenticationService.isEcmLoggedIn() || this.withCredentials) {
|
||||
if (redirectFragment) {
|
||||
this.router.navigateByUrl(redirectFragment);
|
||||
this.storageService.removeItem('loginFragment');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
this.redirectToUrl('ECM', redirectUrl);
|
||||
|
Loading…
x
Reference in New Issue
Block a user