Repository navigation
chore(nextjs): Display keyless prompt until .clerk/ is removed - #4940
panteliselef merged 15 commits into
Conversation
🦋 Changeset detectedLatest commit: 1b36a4a 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 |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| if (runningWithClaimedKeys) { | ||
| output = clientProvider; | ||
| } else { | ||
| output = <KeylessCookieSync {...newOrReadKeys}>{clientProvider}</KeylessCookieSync>; | ||
| } |
There was a problem hiding this comment.
We want to keep rendering the Keyless prompt which is controlled by the props passed to ClientClerkProvider but we don't want the rest of the app to act like it was on keyless since the developer has now set the keys explicitly.
| __internal_claimKeylessApplicationUrl: newOrReadKeys.claimUrl, | ||
| __internal_copyInstanceKeysUrl: newOrReadKeys.apiKeysUrl, | ||
| __internal_keyless_dismissPrompt: runningWithClaimedKeys ? deleteKeylessAction : undefined, |
There was a problem hiding this comment.
All of these props are related to keyless, but they use different naming schemes. Can we make them consistent? Proposal:
| __internal_claimKeylessApplicationUrl: newOrReadKeys.claimUrl, | |
| __internal_copyInstanceKeysUrl: newOrReadKeys.apiKeysUrl, | |
| __internal_keyless_dismissPrompt: runningWithClaimedKeys ? deleteKeylessAction : undefined, | |
| __internal_keyless_claimApplicationUrl: newOrReadKeys.claimUrl, | |
| __internal_keyless_copyInstanceKeysUrl: newOrReadKeys.apiKeysUrl, | |
| __internal_keyless_dismissPrompt: runningWithClaimedKeys ? deleteKeylessAction : undefined, |
There was a problem hiding this comment.
Yeap, seems like i never pushed this. Thanks for reminding me.
Co-authored-by: Bryce Kalow <bryce@clerk.dev>
LekoArts
left a comment
There was a problem hiding this comment.
Pending Bryce's comment (https://github.com/clerk/javascript/pull/4940/files#r1922640604), should be done before merge
…essage-when-env-keys-and-local # Conflicts: # packages/clerk-js/src/ui/components/KeylessPrompt/index.tsx # packages/types/src/clerk.ts
Description
[Keyless]
For Developer who use
<ClerkProvider/>as a Server component (not in a "use client" boundary), we can detect when the explicitly set keys match the ones created from keyless. When that is the case, we are now passing a server action to the Clerk UI resulting in the keyless prompt to display a confirmation step which forces the developer to dismiss.Behind the scenes, on dismiss, we are are deleting the
.clerk/directory as it is no longer necessary. That resets the application and opts it out of keyless.Unfortunately developers who are using
<ClerkProvider/>will not get this confirmation step, but instead the prompt will simply disappear.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change