RED-5950 logout error on session expired

This commit is contained in:
Timo Bejan 2023-01-15 14:40:41 +08:00
parent 7f2d33f17b
commit c91f923bfa

View File

@ -58,13 +58,13 @@ export abstract class IqserUserService<
}
async logout() {
await this._cacheApiService.wipeCaches();
if (await this._keycloakService.isLoggedIn()) {
try {
await this._keycloakService.loadUserProfile(true);
await this._cacheApiService.wipeCaches();
await this._keycloakService.logout();
} catch (e) {
await this.redirectToLogin();
}
window.location.href = this._keycloakService.getKeycloakInstance().createLoginUrl({
redirectUri: window.location.origin + this._baseHref,
});
}
async redirectToLogin() {