feat(evals): eval the server-side auth client guide in supabase.com/docs - #261
Open
czenko wants to merge 2 commits into
Open
feat(evals): eval the server-side auth client guide in supabase.com/docs#261czenko wants to merge 2 commits into
czenko wants to merge 2 commits into
Conversation
The guide carries the highest agent share of any task-driven page in the docs cohort, 35.0 percent on 22,918 views, and Server-side Auth is the densest label in feedback intake. The one claim: the dashboard must not render a viewer's identity on the strength of a cookie alone, which is the failure the page warns about itself. The eval measures it behaviorally. It signs a user in through the app, re-encodes the session with a second user's identity, and leaves the signature alone so the token no longer verifies. Reading stored session state accepts that cookie; verifying the token rejects it. Five runtime checks install, build, and serve the Next.js app inside the sandbox, because next is not a framework dependency and the host-side build helpers relink the workspace's node_modules to the framework's own. Three source checks cover the verifying call, the cookie adapter, and the deprecated helpers import. The verifying-call check accepts getClaims() and getUser() both and names the class rather than the method. DOCS-1303 and the scoping doc ask for getUser(); the page now recommends getClaims(). A check on either alone would report the page as broken for giving current advice. Closes DOCS-1303
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
czenko
marked this pull request as ready for review
September 3, 2026 23:30
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.
Closes DOCS-1303
Problem
auth/server-side/creating-a-clientcarries the highest agent share of any task-driven page in the docs cohort, 35.0 percent on 22,918 views, andServer-side Authis the densest label in feedback intake. Nothing measures whether the page gets an agent to a dashboard that will not hand itself to a forged cookie.Solution
build-docs-005-server-side-auth,suite: regression,services: [gotrue, kong, postgrest].POST /login, an unwired login route handler, and an unwired dashboard. The seed fixes the form field names, the login contract, anddata-testid="viewer-email"on the dashboard.a tampered session cookie does not get the dashboardsigns a user in through the app, re-encodes the session with a second user's identity, and leaves the signature alone so the token no longer verifies. Reading stored session state accepts that cookie; verifying the token rejects it. It is gated on the render control passing first, so an app that renders nothing cannot clear it.ctx.exec.nextis not a framework dependency, and the host-side build helpers relink the workspace'snode_modulesto the framework's own, so a host-side build cannot see what the seed declared.auth/troubleshooting/02-session-refresh-and-ssr-failure-patterns.md, andexamples/prompts/nextjs-supabase-auth.mdin the main repo.The verifying-call check accepts
getClaims()andgetUser()both. DOCS-1303 and the scoping doc ask forgetUser(); the page now recommendsgetClaims()and names it the way to protect pages. A check on either alone would report the page as broken for giving current advice, so the check names the class.Two framework problems this surfaced, neither fixed here:
ctx.stackStatus()requiresAPI_URL,PUBLISHABLE_KEYandSECRET_KEYtogether and throws when any is missing. This eval needs the api url and one client key, so it readssupabase statusdirectly and acceptsPUBLISHABLE_KEYorANON_KEY.discoverEvalsreadsPROMPT.mdin every directory underevals/and throws when one is absent, so a git-excludedsolutions/directory left behind by a branch switch breaks discovery for every eval in the repo.Baseline
Six runs, sonnet-5 with and without skills, three each. 9/9 on all six.
The checks are not vacuous. Five fixtures were scored against the stack first and each failed what it was built to fail:
greendeprecated-cookie-methodsauth-helpers-importget-session-onlydashboard-renders-nothingget-session-onlyreads stored session state instead of verifying, and the forged cookie rendered another user's identity. The central check catches a real bypass; agents did not write that code.Read the 9/9 as regression cover rather than benchmark signal. It says the page gets sonnet-5 to a dashboard that rejects a forged cookie. It does not say the page caused that: the guide-read check proves the page was opened, not that it was load-bearing, and a model that already knows the
@supabase/ssrpattern produces the same output. Hardening is worth considering after DOCS-1313 lands, so the two changes do not confound each other.Manual testing
Confirm the ports are free.
Confirm discovery and frontmatter.
One
PLANline per experiment, each readingstage=build suite=regression mode=local-stack.Typecheck.
Clean.
Lint the eval.
No fixes applied.