diff --git a/.changeset/healthy-donuts-grow.md b/.changeset/healthy-donuts-grow.md new file mode 100644 index 000000000..ddea8c512 --- /dev/null +++ b/.changeset/healthy-donuts-grow.md @@ -0,0 +1,5 @@ +--- +'@commercetools/sdk-middleware-auth': patch +--- + +Change token fetch window from 2 hours to 5 minutes. diff --git a/packages/sdk-middleware-auth/src/base-auth-flow.js b/packages/sdk-middleware-auth/src/base-auth-flow.js index 0e19434c1..c0c636b5e 100644 --- a/packages/sdk-middleware-auth/src/base-auth-flow.js +++ b/packages/sdk-middleware-auth/src/base-auth-flow.js @@ -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 ) }