Repository navigation
Conversation
…sion check passes (CORE-1326) With an expired or rejected session the browser keeps csrf_token, and these headers showed "Dashboard" on cookie presence alone while the home page showed "Sign in". The header and every PublicLink now share one probeMe read per page view (GET /api/users/me?optional=1, the dashboard's own check): signed in only when it finds a person. No csrf_token means no request. Tests: tests/session-check.test.ts (node --test --experimental-strip-types, no dependencies); the old cookie-only rule fails 4 of 7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
sonpiaz
marked this pull request as ready for review
December 5, 2026 22:33
A client-side navigation reads again, so a transient failure or a sign-out in another tab is not carried from page to page. Callers on the same page still share one read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
With an expired or rejected session the browser still holds
csrf_token. The blog, changelog and docs headers treated that cookie alone as "signed in" and showed Dashboard, while the home page, /about and /marketplace showed the signed-out header.Now the header and every
PublicLinkshare oneprobeMe()read per page view (the dashboard's own session read, in its optional mode). The visitor counts as signed in only when it returns a person. Nobody (200 null, 401, 403) and an unusable answer (5xx, network) both show the signed-out header. Withoutcsrf_tokenno request is made.Evidence on production (before)
A headless browser with a fake
auth_tokenand a leftovercsrf_token, public pages only:nullnull(twice)Tests
tests/session-check.test.ts, run withnode --test --experimental-strip-types tests/session-check.test.ts(no dependencies). 7 cases:csrf_tokenmeans no request;The old cookie-only rule fails 4 of 7. Mutants also fail: no shared answer, a request without a cookie, "unavailable counts as signed in", and a rejection that propagates.
tsconfig.jsonexcludestests/, so the app type-check does not read the test's.tsimport.Cost
csrf_token, as before./meread for visitors with it. The account menu now renders only for a verified person, so a leftover cookie no longer triggers its two reads.🤖 Generated with Claude Code