Repository navigation
Conversation
`ConvexAuthNextjsServerProvider` rendered the client provider itself and built the `ConvexReactClient` internally, so a Next app couldn't supply its own client: no `ConvexQueryClient` (TanStack Query), no client options, no use of the client outside React. A `ConvexReactClient` can't cross the Server Component boundary, so a `client` prop on the server provider was never an option. Follow v1's split instead. The server provider now reads the cookie and renders a small client context carrying what it knows (the access token, the auth route paths). `ConvexAuthNextjsProvider`, exported at the new `@convex-dev/auth/ssr/nextjs/client` entry, reads that context, so the app renders it from its own `ConvexClientProvider.tsx` with its own client, the same file the Convex Next.js quickstart already has. `setupConvexAuthNextjs` takes `routes` for handlers mounted away from `/auth/*`, resolving the TODO on the server provider; the paths travel in the same context. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RuiNWRbC1cfyoU7jnDzisM
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
There was a problem hiding this comment.
All reported issues were addressed across 10 files
Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack
Re-trigger cubic
erquhart
marked this pull request as draft
October 22, 2026 17:23
Drop the comments that explained the PR rather than the code, restore the
original prop docs, and put "replaces ConvexAuthProvider" back in the setup
docs.
`??=` treated an explicit `initialToken={null}` as omitted and adopted the
server state's token. Fall through only on `undefined`, and make the test
read the token after the auth client's init, where the regression shows.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RuiNWRbC1cfyoU7jnDzisM
commit: |
The server provider no longer passes `convexUrl`, so the client-less path of `ConvexAuthNextjsProvider` fell back to `NEXT_PUBLIC_CONVEX_URL` only. The app owns the client now, so make `client` required and drop `convexUrl`. The "starts signed out" test read the token before init; wait for `isLoading` to clear, as the precedence test does. Point the routes step of the setup docs at the `routes` config. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RuiNWRbC1cfyoU7jnDzisM
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.
This PR splits the server and client providers for Next.js, replacing the single provider that rendered the client itself. This wraps reading the initial token from cookie inside the server provider and requires the app to pass in its own Convex client so it can be directly configured, following prior art. Any future server behavior we want to add in addition to reading the token cookie can now be added within the server provider with the option of avoiding userland changes.
Also snuck in route configurability since we were messing with server setup anyway.
Note that this is a breaking change for Next.js users, updating requires using
ConvexAuthNextJsProvider, passing in their Convex client, and wrapping the app withConvexAuthNextJsServerProvider.