feat(nextjs): Support Keyless mode#4602
Merged
panteliselef merged 35 commits intomainfrom Dec 5, 2024
Merged
Conversation
🦋 Changeset detectedLatest commit: b04a9d2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 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 |
…der and update middleware to read sk and pk from cookies
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
8f908b0 to
18e8fe4
Compare
18e8fe4 to
5e0181d
Compare
React does not like the fact that <html><body> may be missing and that Suspense is not used inside <html>
brkalow
reviewed
Dec 4, 2024
brkalow
approved these changes
Dec 5, 2024
Member
brkalow
left a comment
There was a problem hiding this comment.
👏 left a few minor comments, but functionally I think this is good to go! Nice job
LekoArts
reviewed
Dec 5, 2024
jacekradko
reviewed
Dec 5, 2024
Co-authored-by: Lennart <lekoarts@gmail.com>
…s-in-clerknextjs # Conflicts: # packages/nextjs/src/app-router/server/ClerkProvider.tsx
9 tasks
wobsoriano
pushed a commit
that referenced
this pull request
Feb 8, 2025
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.
Description
Opt-in support for Keyless
This is introduced for
@clerk/nextjsbut more sdks may follow in the future.What does the PR do (for development only).
.clerk/Technical
For ClerkProvider as RSC:
clerkMIddlewaredetects missing sk -> basically calls next() as "signed-out" and let rendering to call Server ClerkProvider -> Server ClerkProvider fetches and creates the keys, stores them into a file -> It passes the keys into a client component that will fire a server action on mount that sets the keys into cookies and redirect to a made up url thatclerkMiddelwareexpects ->clerkMiddlewareruns again, this time detects the cookies that contain the accountless keys and properly propagates the pk and sk further down.For ClerkProvider as Client component: The provider will render which fires a server action that creates the keys and set them into cookies. Once this is completed we return only the PK and the claimUrl and we force the ClerkProvider from clerk-react to remount.
Requirements
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change