Skip to content

Commit

Permalink
#1041 | Clear keycloak auth token on unauthorized http response so th…
Browse files Browse the repository at this point in the history
…at user is taken to login screen
  • Loading branch information
vinayvenu committed Sep 19, 2023
1 parent a7fe24b commit 24a54c9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/common/utils/httpClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,9 @@ class HttpClient {
}
return fetchUtils.fetchJson(url, options).catch(error => {
console.log(error.message);
if (
error.message.indexOf("TokenExpiredException") !== -1 &&
this.idp.idpType === IdpDetails.keycloak
)
if (error.message === "Unauthorized" && this.idp.idpType === IdpDetails.keycloak) {
this.idp.clearAccessToken();
}
throw error;
});
}
Expand Down

0 comments on commit 24a54c9

Please sign in to comment.