[MNT-21636] Use URLTree for redirect (#6691)

* use URLTree for redirect

* use always urltree

* fix e2e

* fix
This commit is contained in:
Eugenio Romano
2021-02-18 17:42:57 +00:00
committed by GitHub
parent 81f9f482b2
commit 4a381b46a5
8 changed files with 49 additions and 83 deletions

View File

@@ -17,7 +17,7 @@
import { Injectable } from '@angular/core';
import {
ActivatedRouteSnapshot, Router
ActivatedRouteSnapshot, Router, UrlTree
} from '@angular/router';
import { AuthenticationService } from './authentication.service';
import { AppConfigService } from '../app-config/app-config.service';
@@ -38,7 +38,7 @@ export class AuthGuardEcm extends AuthGuardBase {
super(authenticationService, router, appConfigService, dialog, storageService);
}
async checkLogin(_: ActivatedRouteSnapshot, redirectUrl: string): Promise<boolean> {
async checkLogin(_: ActivatedRouteSnapshot, redirectUrl: string): Promise<boolean | UrlTree> {
if (this.authenticationService.isEcmLoggedIn() || this.withCredentials) {
return true;
}