Skip to content

Commit

Permalink
Check if kc init
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <[email protected]>
  • Loading branch information
aaronchongth committed Oct 3, 2024
1 parent 92bae36 commit 5ebd638
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/dashboard/src/services/keycloak.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export class KeycloakAuthenticator
}

async init(): Promise<void> {
console.log('kc init');

if (this._initialized) {
debug(`${new Date().toLocaleTimeString()}: already initialized`);
return;
Expand Down Expand Up @@ -90,6 +92,7 @@ export class KeycloakAuthenticator
}

async refreshToken(): Promise<void> {
console.log('refresh token called');
// check and update the token 30 seconds prior to expiry
if (this._initialized) {
const refreshed = await this._inst.updateToken(30);
Expand All @@ -100,7 +103,10 @@ export class KeycloakAuthenticator
this.emit('tokenRefresh', null);
} else {
debug(`${new Date().toLocaleTimeString()}: refreshToken token not refreshed`);
console.log('not refreshed');
}
} else {
console.log('not intialized');
}
return;
}
Expand Down

0 comments on commit 5ebd638

Please sign in to comment.