Skip to content
Snippets Groups Projects
Commit 689d8c3f authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

auth: force a token refresh when it expires

While this shouldn't make a difference because the callback should
only be called when the token is about to be expiring there
is no reason to keep the old token around.

Just force a refresh always
parent 965fb491
No related branches found
No related tags found
No related merge requests found
......@@ -87,17 +87,14 @@ export class KeycloakWrapper extends EventTarget {
let refreshed = false;
try {
refreshed = await this._keycloak.updateToken(5);
// -1 means force a refresh
refreshed = await this._keycloak.updateToken(-1);
} catch (error) {
console.log('Failed to refresh the token', error);
return;
}
if (refreshed) {
console.log('Token was successfully refreshed');
} else {
console.log('Token is still valid');
}
console.assert(refreshed, "token should have been refreshed");
}
async _ensureInstance() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment