Skip to content

Commit

Permalink
fix(auth-token): reduce token fetch window (#1805)
Browse files Browse the repository at this point in the history
- reduce token fetch window from 2 hours to 5 minutes
- add changeset to release changes
  • Loading branch information
ajimae authored Aug 23, 2022
1 parent f6e1ba1 commit 4ef07fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/healthy-donuts-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools/sdk-middleware-auth': patch
---

Change token fetch window from 2 hours to 5 minutes.
4 changes: 2 additions & 2 deletions packages/sdk-middleware-auth/src/base-auth-flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ function calculateExpirationTime(expiresIn: number): number {
return (
Date.now() +
expiresIn * 1000 -
// Add a gap of 2 hours before expiration time.
2 * 60 * 60 * 1000
// Add a gap of 5 minutes before expiration time.
5 * 60 * 1000
)
}

Expand Down

0 comments on commit 4ef07fa

Please sign in to comment.