Skip to content

chore(ui,shared,localizations): Add verify/add email address step to <ConfigureSSO />#8520

Open
LauraBeatris wants to merge 5 commits into
mainfrom
laura/orgs-1455-configuresso-addverify-email-address-step
Open

chore(ui,shared,localizations): Add verify/add email address step to <ConfigureSSO />#8520
LauraBeatris wants to merge 5 commits into
mainfrom
laura/orgs-1455-configuresso-addverify-email-address-step

Conversation

@LauraBeatris
Copy link
Copy Markdown
Member

@LauraBeatris LauraBeatris commented May 11, 2026

Description

  • Handles warning when there's already a connection created for the given domain when changing to an organization context
  • Handles adding an primary email address when user account is created with username/phone as identifiers
  • Handles verifying email address if not performed previously via sign-in/sign-up

Add + verify

CleanShot.2026-05-11.at.15.55.03.mp4

Verify only

CleanShot.2026-05-11.at.16.06.36.mp4

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@LauraBeatris LauraBeatris self-assigned this May 11, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 11, 2026

🦋 Changeset detected

Latest commit: 0b25a46

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
Name Type
@clerk/localizations Patch
@clerk/clerk-js Patch
@clerk/shared Patch
@clerk/ui Patch
@clerk/react Patch
@clerk/chrome-extension Patch
@clerk/expo Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/expo-passkeys Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/hono Patch
@clerk/msw Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/vue Patch

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

@vercel
Copy link
Copy Markdown

vercel Bot commented May 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment May 11, 2026 7:22pm

Request Review

@LauraBeatris LauraBeatris changed the title chore(ui): Add verify/add email address step to <ConfigureSSO /> chore(ui,shared,localizations): Add verify/add email address step to <ConfigureSSO /> May 11, 2026
@LauraBeatris
Copy link
Copy Markdown
Member Author

I'll add unit tests once #8515 gets merged since it introduces the spec over there

@LauraBeatris LauraBeatris force-pushed the laura/orgs-1455-configuresso-addverify-email-address-step branch from 9c16c94 to 367857b Compare May 11, 2026 19:07
@LauraBeatris LauraBeatris force-pushed the laura/orgs-1455-configuresso-addverify-email-address-step branch from 367857b to 53e04c8 Compare May 11, 2026 19:12
@LauraBeatris LauraBeatris force-pushed the laura/orgs-1455-configuresso-addverify-email-address-step branch from 53e04c8 to d27cc13 Compare May 11, 2026 19:14
@LauraBeatris LauraBeatris requested review from a team and iagodahlem May 11, 2026 19:14
@LauraBeatris LauraBeatris marked this pull request as ready for review May 11, 2026 19:15
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 11, 2026

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@8520

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@8520

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@8520

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@8520

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@8520

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@8520

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@8520

@clerk/express

npm i https://pkg.pr.new/@clerk/express@8520

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@8520

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@8520

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@8520

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@8520

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@8520

@clerk/react

npm i https://pkg.pr.new/@clerk/react@8520

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@8520

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@8520

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@8520

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@8520

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@8520

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@8520

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@8520

commit: 0b25a46

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a new email verification step to the experimental ConfigureSSO flow. The change spans multi-language localization strings across 40+ supported languages, TypeScript type definitions for the new localization structure, React components for email entry and OTP verification, and supporting assets. The implementation detects when the configured domain is already taken by another organization and provides appropriate early-exit messaging. The feature is broken into three sub-components: ProvideEmailStep for email collection, EnterVerificationCodeStep for OTP-based verification, and EmailAlreadyVerified for displaying verified-state confirmation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • clerk/javascript#8427: Extends ConfigureSSO scaffolding that was introduced by the retrieved PR, building on the same localization and type structures.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding a verify/add email address step to the ConfigureSSO component across UI, shared types, and localizations.
Description check ✅ Passed The description is directly related to the changeset, explaining the functional purpose of the changes (domain connection warnings, email address addition, email verification) with supporting visuals.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/ui/src/components/ConfigureSSO/steps/VerifyDomainStep.tsx`:
- Around line 223-227: The Continue button currently calls goNext() directly
(Step.Footer.Continue onClick={() => goNext()}) which skips createEmailAddress()
and causes EnterVerificationCodeStep to receive no emailToVerify; change the
onClick to call handleSubmit (or the wrapper that executes createEmailAddress()
then advances) so the add+verify flow runs createEmailAddress() before moving
forward, ensuring emailToVerify is set for EnterVerificationCodeStep and
preserving the existing isLoading/isDisabled checks.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 62663121-c78d-41df-9d3f-35a4875f7f1a

📥 Commits

Reviewing files that changed from the base of the PR and between 0f8aed2 and d27cc13.

⛔ Files ignored due to path filters (1)
  • packages/ui/src/icons/duotone-at-symbol.svg is excluded by !**/*.svg
📒 Files selected for processing (53)
  • .changeset/thirty-cups-guess.md
  • packages/localizations/src/ar-SA.ts
  • packages/localizations/src/be-BY.ts
  • packages/localizations/src/bg-BG.ts
  • packages/localizations/src/bn-IN.ts
  • packages/localizations/src/ca-ES.ts
  • packages/localizations/src/cs-CZ.ts
  • packages/localizations/src/da-DK.ts
  • packages/localizations/src/de-DE.ts
  • packages/localizations/src/el-GR.ts
  • packages/localizations/src/en-GB.ts
  • packages/localizations/src/en-US.ts
  • packages/localizations/src/es-CR.ts
  • packages/localizations/src/es-ES.ts
  • packages/localizations/src/es-MX.ts
  • packages/localizations/src/es-UY.ts
  • packages/localizations/src/fa-IR.ts
  • packages/localizations/src/fi-FI.ts
  • packages/localizations/src/fr-FR.ts
  • packages/localizations/src/he-IL.ts
  • packages/localizations/src/hi-IN.ts
  • packages/localizations/src/hr-HR.ts
  • packages/localizations/src/hu-HU.ts
  • packages/localizations/src/id-ID.ts
  • packages/localizations/src/is-IS.ts
  • packages/localizations/src/it-IT.ts
  • packages/localizations/src/ja-JP.ts
  • packages/localizations/src/kk-KZ.ts
  • packages/localizations/src/ko-KR.ts
  • packages/localizations/src/mn-MN.ts
  • packages/localizations/src/ms-MY.ts
  • packages/localizations/src/nb-NO.ts
  • packages/localizations/src/nl-BE.ts
  • packages/localizations/src/nl-NL.ts
  • packages/localizations/src/pl-PL.ts
  • packages/localizations/src/pt-BR.ts
  • packages/localizations/src/pt-PT.ts
  • packages/localizations/src/ro-RO.ts
  • packages/localizations/src/ru-RU.ts
  • packages/localizations/src/sk-SK.ts
  • packages/localizations/src/sr-RS.ts
  • packages/localizations/src/sv-SE.ts
  • packages/localizations/src/ta-IN.ts
  • packages/localizations/src/te-IN.ts
  • packages/localizations/src/th-TH.ts
  • packages/localizations/src/tr-TR.ts
  • packages/localizations/src/uk-UA.ts
  • packages/localizations/src/vi-VN.ts
  • packages/localizations/src/zh-CN.ts
  • packages/localizations/src/zh-TW.ts
  • packages/shared/src/types/localization.ts
  • packages/ui/src/components/ConfigureSSO/steps/VerifyDomainStep.tsx
  • packages/ui/src/icons/index.ts

Comment on lines 223 to 227
<Step.Footer.Continue
onClick={() => goNext()}
isDisabled={isLastStep}
isLoading={card.isLoading}
isDisabled={!canSubmit || card.isLoading}
/>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot May 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Wire the add-email CTA through handleSubmit.

The primary Continue button skips createEmailAddress() and advances straight to the verification step. In the add+verify flow, that can land on EnterVerificationCodeStep with no emailToVerify, which renders nothing and blocks the user.

Suggested fix
         <Step.Footer.Continue
-          onClick={() => goNext()}
+          onClick={() => {
+            void handleSubmit();
+          }}
           isLoading={card.isLoading}
           isDisabled={!canSubmit || card.isLoading}
         />
📝 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.

Suggested change
<Step.Footer.Continue
onClick={() => goNext()}
isDisabled={isLastStep}
isLoading={card.isLoading}
isDisabled={!canSubmit || card.isLoading}
/>
<Step.Footer.Continue
onClick={() => {
void handleSubmit();
}}
isLoading={card.isLoading}
isDisabled={!canSubmit || card.isLoading}
/>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui/src/components/ConfigureSSO/steps/VerifyDomainStep.tsx` around
lines 223 - 227, The Continue button currently calls goNext() directly
(Step.Footer.Continue onClick={() => goNext()}) which skips createEmailAddress()
and causes EnterVerificationCodeStep to receive no emailToVerify; change the
onClick to call handleSubmit (or the wrapper that executes createEmailAddress()
then advances) so the add+verify flow runs createEmailAddress() before moving
forward, ensuring emailToVerify is set for EnterVerificationCodeStep and
preserving the existing isLoading/isDisabled checks.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes sense, if someone tries to click continue on the footer rather than hitting enter on the input, would skip the email creation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iagodahlem, exactly — handleSubmit already has the full guard logic (canSubmit check → createEmailAddressgoNext on success), so routing the footer button through it keeps both paths (Enter key via Form.Root onSubmit and the explicit Continue click) consistent. The suggested fix should close the gap.

@LauraBeatris LauraBeatris force-pushed the laura/orgs-1455-configuresso-addverify-email-address-step branch from d27cc13 to 0b25a46 Compare May 11, 2026 19:21
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/ui/src/components/ConfigureSSO/steps/VerifyDomainStep.tsx (1)

229-232: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Route the Continue CTA through handleSubmit.

This still skips createEmailAddress() and advances straight to the OTP step. In the add+verify path, that can leave emailToVerify unset, so EnterVerificationCodeStep returns null and the flow dead-ends. As per coding guidelines, "Use proper form submission handling in React components".

Suggested fix
         <Step.Footer.Continue
-          onClick={() => goNext()}
+          onClick={() => {
+            void handleSubmit();
+          }}
           isLoading={card.isLoading}
           isDisabled={!canSubmit || card.isLoading}
         />
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui/src/components/ConfigureSSO/steps/VerifyDomainStep.tsx` around
lines 229 - 232, The Continue button currently calls goNext() directly which
skips form submission and createEmailAddress(), leaving emailToVerify unset and
causing EnterVerificationCodeStep to return null; change the
Step.Footer.Continue onClick to call handleSubmit (the existing form submit
handler) instead of goNext so the form validates and createEmailAddress() runs
before advancing, keep the isLoading and isDisabled props (card.isLoading and
!canSubmit || card.isLoading) as-is, and ensure handleSubmit ultimately calls
goNext() only after createEmailAddress() completes successfully.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/ui/src/components/ConfigureSSO/steps/VerifyDomainStep.tsx`:
- Line 247: The Previous button in VerifyDomainStep is currently always disabled
(using useWizard's goPrev) which prevents returning to the email-entry step;
update the disable logic so the back action is only disabled when this step is
actually the first step—use the wizard state (e.g., an isFirst or
currentStep/index value from useWizard or the wizard context) to conditionally
enable goPrev, and apply the same change in the other occurrence around lines
335-343 so users can recover from a mistyped email by navigating back to the
email-entry component instead of being stuck on the OTP screen.

---

Duplicate comments:
In `@packages/ui/src/components/ConfigureSSO/steps/VerifyDomainStep.tsx`:
- Around line 229-232: The Continue button currently calls goNext() directly
which skips form submission and createEmailAddress(), leaving emailToVerify
unset and causing EnterVerificationCodeStep to return null; change the
Step.Footer.Continue onClick to call handleSubmit (the existing form submit
handler) instead of goNext so the form validates and createEmailAddress() runs
before advancing, keep the isLoading and isDisabled props (card.isLoading and
!canSubmit || card.isLoading) as-is, and ensure handleSubmit ultimately calls
goNext() only after createEmailAddress() completes successfully.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 1004fa64-a006-455f-9ec2-98e4c515e64d

📥 Commits

Reviewing files that changed from the base of the PR and between d27cc13 and 0b25a46.

📒 Files selected for processing (2)
  • .changeset/thirty-cups-guess.md
  • packages/ui/src/components/ConfigureSSO/steps/VerifyDomainStep.tsx
✅ Files skipped from review due to trivial changes (1)
  • .changeset/thirty-cups-guess.md

const { user } = useUser();
const card = useCardState();
const codeSubmittedRef = useRef(false);
const { goNext, goPrev } = useWizard();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Keep a recovery path back to the email-entry step.

Previous is hard-disabled on the OTP screen. In the add+verify flow, a typoed but valid email sends the code to the wrong address and leaves the user with no way to correct it, which blocks completion. Only disable back-navigation when this step is actually the first step. As per coding guidelines, "Implement proper error recovery in React applications".

Suggested fix
-  const { goNext, goPrev } = useWizard();
+  const { goNext, goPrev, isFirstStep } = useWizard();
...
        <Step.Footer.Previous
          onClick={() => goPrev()}
-          isDisabled
+          isDisabled={isFirstStep}
        />

Also applies to: 335-343

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui/src/components/ConfigureSSO/steps/VerifyDomainStep.tsx` at line
247, The Previous button in VerifyDomainStep is currently always disabled (using
useWizard's goPrev) which prevents returning to the email-entry step; update the
disable logic so the back action is only disabled when this step is actually the
first step—use the wizard state (e.g., an isFirst or currentStep/index value
from useWizard or the wizard context) to conditionally enable goPrev, and apply
the same change in the other occurrence around lines 335-343 so users can
recover from a mistyped email by navigating back to the email-entry component
instead of being stuck on the OTP screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants