[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

@@ -16,7 +16,7 @@
*/
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Router } from '@angular/router';
import { ActivatedRouteSnapshot, Router, UrlTree } from '@angular/router';
import { AppConfigService } from '../app-config/app-config.service';
import { AuthenticationService } from './authentication.service';
import { AuthGuardBase } from './auth-guard-base';
@@ -36,7 +36,7 @@ export class AuthGuardBpm 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.isBpmLoggedIn() || this.withCredentials) {
return true;
}