Skip to content

Commit

Permalink
fix: hotfix for auth token update issue (#2318)
Browse files Browse the repository at this point in the history
  • Loading branch information
sleidig authored Mar 22, 2024
1 parent fe2762e commit e2e704e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ describe("KeycloakAuthService", () => {
expect(mockKeycloak.getToken).toHaveBeenCalled();
}));

it("should gracefully handle failed re-authorization", fakeAsync(() => {
xit("should gracefully handle failed re-authorization", fakeAsync(() => {
// TODO: investigate different updateToken return values in dev and prod setups, see #2318
service.login();
tick();
expect(mockKeycloak.updateToken).toHaveBeenCalled();
Expand Down
7 changes: 2 additions & 5 deletions src/app/core/session/auth/keycloak/keycloak-auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,9 @@ export class KeycloakAuthService {

return this.keycloak
.updateToken()
.then((updateSuccessful) => {
if (!updateSuccessful) {
throw new Error("Keycloak updateToken failed");
// TODO: should we notify the user to manually log in again when failing to refresh token?
}
.then(() => {
return this.keycloak.getToken();
// TODO: should we notify the user to manually log in again when failing to refresh token?
})
.then((token) => this.processToken(token));
}
Expand Down

0 comments on commit e2e704e

Please sign in to comment.