feat(js,shared): always send the session-minter request shape for /tokens#8638
feat(js,shared): always send the session-minter request shape for /tokens#8638nikosdouvlis wants to merge 1 commit into
Conversation
…kens The `auth_config.session_minter` gate in clerk-js no longer adds value: the FAPI proxy strips `token` and `force_origin` from the /tokens body unconditionally, and the Go backend has a matching strip-and-capture safety net. So clerk-js can send the minter shape for every instance without breaking the ones the Minter hasn't activated yet. This also lets the next iteration drop the remaining Go-side flag without a coordinated rollout. - `AuthConfigResource.sessionMinter` and `AuthConfigJSON.session_minter` are removed - The `expired_token` retry on 422 `missing_expired_token` was the fallback for non-minter clients; it goes away with the gate - Tests updated; the legacy-retry describe block is deleted
🦋 Changeset detectedLatest commit: 260061f The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@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: |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
💤 Files with no reviewable changes (4)
📝 WalkthroughWalkthroughThis PR removes the Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
The
auth_config.session_mintergate in clerk-js no longer adds value. The FAPI proxy in cloudflare-workers stripstokenandforce_originfrom the /tokens body unconditionally (regardless ofSESSION_MINTER_DISPATCH_ENABLED), and the Go backend's/tokenshandler has a matching strip-and-sentry safety net. So clerk-js can send the minter shape for every instance without breaking the ones the Minter hasn't activated yet.Paired with clerk_go#19095, which drops the corresponding
FLAG_SESSION_TOKEN_OIAT_INSTANCE_IDSandFLAG_SYNC_SESSION_TO_EDGE_INSTANCE_IDSflags on the Go side.What changes
AuthConfigResource.sessionMinterandAuthConfigJSON.session_minterare removedSession.#createTokenResolveralways includestoken(whenlastActiveTokenexists) andforceOrigin: 'true'(whenskipCache) in the POST bodyexpired_tokenretry on 422missing_expired_tokenwas the fallback for non-minter clients - removed along with the gate@clerk/clerk-jsand@clerk/shared)Why this is safe
undefinedon the AuthConfig instance just routes them through their existing legacy pathSESSION_MINTER_DISPATCH_ENABLED=false, currently prod), the FAPI proxy strips the extra body fields before forwarding to origin, so Go receives the same payload it always didTest plan
pnpm --filter @clerk/clerk-js test src/core/resources/__tests__/Session.test.ts src/core/resources/__tests__/AuthConfig.test.ts(71 pass)pnpm --filter @clerk/clerk-js build:declarationsclean vs main (no new TS errors)clerk-jsalways carriestokenin body for non-template mints