Skip to content

Commit 4ef07fa

Browse files
authored
fix(auth-token): reduce token fetch window (#1805)
- reduce token fetch window from 2 hours to 5 minutes - add changeset to release changes
1 parent f6e1ba1 commit 4ef07fa

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.changeset/healthy-donuts-grow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@commercetools/sdk-middleware-auth': patch
3+
---
4+
5+
Change token fetch window from 2 hours to 5 minutes.

packages/sdk-middleware-auth/src/base-auth-flow.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ function calculateExpirationTime(expiresIn: number): number {
2929
return (
3030
Date.now() +
3131
expiresIn * 1000 -
32-
// Add a gap of 2 hours before expiration time.
33-
2 * 60 * 60 * 1000
32+
// Add a gap of 5 minutes before expiration time.
33+
5 * 60 * 1000
3434
)
3535
}
3636

0 commit comments

Comments
 (0)