Repository navigation
fix(auth): sessions authenticate by bearer only - #2477
Merged
Merged
Maple Review Bot / Maple / review
succeeded
Nov 10, 2026 in 41s
Confidence 10/10 · No issues found
🟢 Confidence 10/10 · safe to merge. Both new behaviours — cookie never read by toHeaders, cookie stripped by the /_api proxy — are pinned by tests that fail on main; the only new commit adds one such test.
no findings · tests covered · risk high
Sessions now authenticate by the Authorization bearer only: toHeaders forwards nothing else to Clerk, the /_api proxy drops Cookie, and MCP stops counting a cookie as a credential. Contained and safe to merge; the comment at apps/ai/src/runtime/auth-graph.ts:16 still says "session cookie".
toHeadersforwards only theauthorizationheader to Clerk'sauthenticateRequest/_apiforwarding deletes the incomingCookieheader before the binding call- MCP
carriesCredentialno longer treats a cookie as a credential - New tests: cookie-only rejection in
packages/authandapps/ai, cookie stripped inapps/web
What was checked
toHeadersis reached only throughtoRequestinauthenticateClerkUser(packages/auth/src/index.ts:197), so no other auth path loses headers- Electric shape fetches send the session bearer (
apps/web/src/platform/api-clients.ts:79), so live sync is unaffected /_apihas no second forwarding path: a missing binding 503s before any request is built (api-proxy-forward.ts:37), so no path still carries cookies
9259676 · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Loading