Skip to content

Commit

Permalink
more logging with kc
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 334c88c commit 92bae36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/dashboard/src/services/keycloak.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export class KeycloakAuthenticator
if (this._initialized) {
const refreshed = await this._inst.updateToken(30);
if (refreshed) {
console.log('token refreshed');
this._user = this._getUser();
this._isAdmin = this._isUserAdmin();
this.emit('tokenRefresh', null);
Expand Down
3 changes: 3 additions & 0 deletions packages/dashboard/src/services/rmf-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,15 @@ export class DefaultRmfApi implements RmfApi {
const axiosInst = axios.create();
axiosInst.interceptors.request.use(
async (req) => {
console.log('requesting');
await authenticator.refreshToken();
console.log('after refresh');
const token = authenticator.token;
if (!token) {
console.log('no token');
return req;
}
console.log(`token: ${token}`);
req.headers['Authorization'] = `Bearer ${token}`;
console.log(`req ${req}`);
return req;
Expand Down

0 comments on commit 92bae36

Please sign in to comment.