-
Notifications
You must be signed in to change notification settings - Fork 402
chore(nextjs): Display keyless prompt until .clerk/ is removed
#4940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(nextjs): Display keyless prompt until .clerk/ is removed
#4940
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeap, seems like i never pushed this. Thanks for reminding me.
Co-authored-by: Bryce Kalow <bryce@clerk.dev>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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