RED-4828: Logout after session timeout redirects to login page.

This commit is contained in:
Nicoleta Panaghiu 2022-08-02 15:15:42 +03:00
parent c17ba13b4f
commit c3aebd9433

View File

@ -18,10 +18,13 @@ export class IqserAuthGuard extends KeycloakAuthGuard {
async isAccessAllowed(route: ActivatedRouteSnapshot): Promise<boolean> { async isAccessAllowed(route: ActivatedRouteSnapshot): Promise<boolean> {
if (!this.authenticated) { if (!this.authenticated) {
const kcIdpHint = route.queryParamMap.get('kc_idp_hint'); const kcIdpHint = route.queryParamMap.get('kc_idp_hint');
await this._keycloak.login({ const options: any = {
idpHint: kcIdpHint ?? this._configService.values.OAUTH_IDP_HINT,
redirectUri: window.location.href, redirectUri: window.location.href,
}); };
if (kcIdpHint ?? this._configService.values.OAUTH_IDP_HINT) {
options.idpHint = kcIdpHint ?? this._configService.values.OAUTH_IDP_HINT;
}
await this._keycloak.login(options);
return false; return false;
} }