feat(clerk-js,shared): SignUp email link verification#7745
feat(clerk-js,shared): SignUp email link verification#7745
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 923f052 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 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 |
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
📝 WalkthroughWalkthroughAdds email-link verification to SignUpFuture: new type SignUpFutureEmailLinkSendParams; new methods sendEmailLink and waitForEmailLinkVerification on SignUpFuture and SignUpFutureVerifications; an emailLinkVerification getter that reads verification state from URL query params in-browser; sendEmailLink normalizes redirect URLs and posts a prepare_verification with strategy "email_link"; waitForEmailLinkVerification polls until status becomes "verified" or "expired". Tests, shared types, React StateProxy exposures, a changeset, and a bundle size tweak were added. Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.changeset/busy-wolves-rush.md:
- Line 7: Update the phrase "email link based verification" to the hyphenated
compound adjective "email-link-based verification" in the changelog text (the
sentence containing "Add support for email link based verification"); search for
that exact phrase and replace it with the hyphenated form to ensure proper
grammar.
| '@clerk/react': minor | ||
| --- | ||
|
|
||
| Add support for email link based verification to SignUpFuture |
There was a problem hiding this comment.
Hyphenate the compound adjective.
The phrase "email link based" should be hyphenated as "email-link-based" when used as a compound adjective modifying "verification".
✏️ Proposed fix
-Add support for email link based verification to SignUpFuture
+Add support for email-link-based verification to SignUpFuture📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Add support for email link based verification to SignUpFuture | |
| Add support for email-link-based verification to SignUpFuture |
🧰 Tools
🪛 LanguageTool
[grammar] ~7-~7: Use a hyphen to join words.
Context: ...': minor --- Add support for email link based verification to SignUpFuture
(QB_NEW_EN_HYPHEN)
🤖 Prompt for AI Agents
In @.changeset/busy-wolves-rush.md at line 7, Update the phrase "email link
based verification" to the hyphenated compound adjective "email-link-based
verification" in the changelog text (the sentence containing "Add support for
email link based verification"); search for that exact phrase and replace it
with the hyphenated form to ensure proper grammar.
| } | ||
|
|
||
| async sendEmailLink(params: SignUpFutureEmailLinkSendParams): Promise<{ error: ClerkError | null }> { | ||
| const { verificationUrl } = params; |
There was a problem hiding this comment.
Does this need a client-only guard?
There was a problem hiding this comment.
I mean, none of the other methods do that so probably no?
| .reload() | ||
| .then(res => { | ||
| const status = res.verifications.emailAddress.status; | ||
| if (status === 'verified' || status === 'expired') { |
There was a problem hiding this comment.
Are these all of the statuses that should short-circuit the poller? Saw these also 'failed' | 'client_mismatch'
There was a problem hiding this comment.
yeah, the existing createEmailLinkFlow only checks for those statuses https://github.com/clerk/javascript/blob/main/packages/clerk-js/src/core/resources/SignIn.ts#L285
I think (maybe?) those statuses are possible in the __clerk_status parameter, not the verifications property on the SignUp resource.
Description
This PR adds support for email link based verification during sign-up to our new hooks/signal implementation.
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
New Features
Tests