Skip to content

Commit

Permalink
Preventing redundant token fetches
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelGHSeg committed Sep 11, 2023
1 parent 63e6342 commit 53c5030
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/node/src/lib/oauth-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export interface OauthData {
export const RefreshToken = (data: OauthData) => {
clearTimeout(data.refreshTimer)
data.refreshTimer = undefined
data.refreshPromise = RefreshTokenAsync(data)
if (!data.refreshPromise) {
data.refreshPromise = RefreshTokenAsync(data)
}
}

export const RefreshTokenAsync = async (data: OauthData) => {
Expand Down

0 comments on commit 53c5030

Please sign in to comment.