fix(clerk-js): Backport using JWT iat for token cache timing#8987
fix(clerk-js): Backport using JWT iat for token cache timing#8987thazhemadam wants to merge 1 commit into
iat for token cache timing#8987Conversation
🦋 Changeset detectedLatest commit: 2453740 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@jacekradko is attempting to deploy a commit to the Clerk Production Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
`SessionTokenCache` used cache insertion time as the start of a token’s lifetime, even though the lifetime itself comes from `exp - iat`. Tokens added to the cache after issuance could therefore stay in the fresh/stale windows too long and be returned after expiry. Record the JWT iat as the cache start time once the token resolves, so stale-while-revalidate and expiry thresholds follow the token’s actual lifetime. (cherry picked from commit d5075a7 which was squashed and merged in 3ff86c4).
c7767c2 to
2453740
Compare
Description
Backports using JWT
iatfor token cache timing from d5075a7 in #7317 to the Core 2 release line.SessionTokenCacheused cache insertion time as the start of a token’s lifetime, even though the lifetime itself comes fromexp - iat. Tokens added to the cache after issuance could therefore stay in the fresh/stale windows too long and be returned after expiry.Record the JWT iat as the cache start time once the token resolves, so stale-while-revalidate and expiry thresholds follow the token’s actual lifetime.
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change