SUPPORT-9601: fix
This commit is contained in:
parent
f68ef9d32e
commit
d249cdc3dd
1 changed files with 4 additions and 3 deletions
|
|
@ -10,7 +10,7 @@ import {AccessChecker} from "../AccessChecker";
|
||||||
@Injectable({providedIn: 'root'})
|
@Injectable({providedIn: 'root'})
|
||||||
export abstract class AuthGuard implements CanActivate {
|
export abstract class AuthGuard implements CanActivate {
|
||||||
private cspTimeout: number;
|
private cspTimeout: number;
|
||||||
private readonly UL_LANDING_PAGE_URL = '/lkrp/ul/home.html'
|
private landingUlUrl: string;
|
||||||
|
|
||||||
protected constructor(
|
protected constructor(
|
||||||
protected router: Router,
|
protected router: Router,
|
||||||
|
|
@ -21,6 +21,7 @@ export abstract class AuthGuard implements CanActivate {
|
||||||
private progressIndicationService: ProgressIndicationService
|
private progressIndicationService: ProgressIndicationService
|
||||||
) {
|
) {
|
||||||
this.cspTimeout = this.appConfigService.getParamValue("csp_load_timeout");
|
this.cspTimeout = this.appConfigService.getParamValue("csp_load_timeout");
|
||||||
|
this.landingUlUrl = this.appConfigService.getParamValue("landing_ul_url");
|
||||||
}
|
}
|
||||||
|
|
||||||
public canActivate(route: ActivatedRouteSnapshot,
|
public canActivate(route: ActivatedRouteSnapshot,
|
||||||
|
|
@ -28,14 +29,14 @@ export abstract class AuthGuard implements CanActivate {
|
||||||
let url = new URL(window.location.href);
|
let url = new URL(window.location.href);
|
||||||
if (!AccessChecker.checkBrowser()) {
|
if (!AccessChecker.checkBrowser()) {
|
||||||
this.progressIndicationService.hideProgressBar();
|
this.progressIndicationService.hideProgressBar();
|
||||||
window.open(url.origin + this.UL_LANDING_PAGE_URL, "_self");
|
window.open(url.origin + this.landingUlUrl, "_self");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return AccessChecker.checkCsp(this.cspTimeout)
|
return AccessChecker.checkCsp(this.cspTimeout)
|
||||||
.then((cspCheckPassed) => {
|
.then((cspCheckPassed) => {
|
||||||
if (!cspCheckPassed) {
|
if (!cspCheckPassed) {
|
||||||
window.open(url.origin + this.UL_LANDING_PAGE_URL, "_self");
|
window.open(url.origin + this.landingUlUrl, "_self");
|
||||||
return Promise.reject("CSP check failed - redirecting to home")
|
return Promise.reject("CSP check failed - redirecting to home")
|
||||||
}
|
}
|
||||||
return Promise.resolve(this.checkAccess());
|
return Promise.resolve(this.checkAccess());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue