Skip to content

Commit

Permalink
fix: use new access token in the current handleRequest call (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
vanpham-sw authored Jan 27, 2025
1 parent e1213c2 commit 93fcf95
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/services/AdminApiContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ export class AdminApiContext {

if (response.status() === 401) {
await this.refreshAccessToken();
response = await methodMap[method](url, options);
const updatedOptions = { ...options, headers: { Authorization: `Bearer ${this.options['access_token']}` }};
response = await methodMap[method](url, updatedOptions);
}

return response;
Expand Down

0 comments on commit 93fcf95

Please sign in to comment.