SUPPORT-9601: fix

This commit is contained in:
adel.ka 2025-11-25 11:31:59 +03:00
parent f68ef9d32e
commit d249cdc3dd

View file

@ -10,7 +10,7 @@ import {AccessChecker} from "../AccessChecker";
@Injectable({providedIn: 'root'})
export abstract class AuthGuard implements CanActivate {
private cspTimeout: number;
private readonly UL_LANDING_PAGE_URL = '/lkrp/ul/home.html'
private landingUlUrl: string;
protected constructor(
protected router: Router,
@ -21,6 +21,7 @@ export abstract class AuthGuard implements CanActivate {
private progressIndicationService: ProgressIndicationService
) {
this.cspTimeout = this.appConfigService.getParamValue("csp_load_timeout");
this.landingUlUrl = this.appConfigService.getParamValue("landing_ul_url");
}
public canActivate(route: ActivatedRouteSnapshot,
@ -28,14 +29,14 @@ export abstract class AuthGuard implements CanActivate {
let url = new URL(window.location.href);
if (!AccessChecker.checkBrowser()) {
this.progressIndicationService.hideProgressBar();
window.open(url.origin + this.UL_LANDING_PAGE_URL, "_self");
window.open(url.origin + this.landingUlUrl, "_self");
return false;
}
return AccessChecker.checkCsp(this.cspTimeout)
.then((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.resolve(this.checkAccess());