feat(clerk-js): Send previous session token on /tokens requests#8105
feat(clerk-js): Send previous session token on /tokens requests#8105nikosdouvlis wants to merge 4 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 2b6ae78 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 |
Send the current session JWT as `token` in the POST body when requesting a token refresh. This lets the FAPI Proxy forward it to Session Minter for claim cloning without a DB read. Uses conditional spread so the key is absent (not `token=`) when there's no previous token (first mint).
f0b2a14 to
cbc83a0
Compare
Unit tests verify the token param is present when lastActiveToken exists, absent on first mint, absent for template requests, and matches getRawString() exactly. E2e test verifies token refresh still works with the new param in the POST body.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis pull request adds support for Session Minter edge token minting by enabling the transmission of previous session tokens on 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
Comment |
…nter flag Only send the previous session JWT in the POST body when the environment has session_minter enabled. This lets us roll out Session Minter incrementally via the environment config.
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
…Config AuthConfig is the right home for this since it controls auth behavior, not environment-level display/maintenance settings.
Why
Session Minter needs the previous session JWT to clone claims at the edge without hitting the DB.
What
Send
token(previous session JWT) in the POST body on non-template/tokensrequests. Uses conditional spread so the key is absent (nottoken=) when there's no previous token.The
tokenparam is currently ignored by the backend and will be wired up in PLAT-2471.Test plan
tokenappears in POST body when a previous token existstokenkey is absent on first minttokenis not sent for template token requestsSummary by CodeRabbit
New Features
Tests