Skip to content

fix(mosaic): prompt for reverification before deleting an organization - #10907

Open
gabrielmeloc22 wants to merge 1 commit into
mainfrom
gabriel/orgs-2087-mosaic-org-delete-reverification
Open

gabrielmeloc22 wants to merge 1 commit into
mainfrom
gabriel/orgs-2087-mosaic-org-delete-reverification

Conversation

@gabrielmeloc22

Copy link
Copy Markdown
Contributor

Mosaic's OrganizationProfile deletes an organization without the reverification wrapper. Once an instance opts in to requiring reverification for organization deletion (clerk/clerk_go#24274), org admins outside the reverification window get a session_reverification_required error in the confirm dialog instead of the verification prompt, and can't delete the organization.

The delete now goes through useReverificationFlow and passes its controller to useConfirmController, the same way UserProfileDangerSection handles account deletion. The new feature test has FAPI demand reverification once, enters the password in the prompt, and checks that the organization is deleted.

Same change as #10871, for Mosaic. Raised in review on clerk/dashboard#10805.

Part of ORGS-2087

Mosaic's OrganizationProfile deletes an organization without the reverification wrapper. On instances that require reverification for it, org admins see a session_reverification_required error instead of the verification prompt, and can't delete the organization. The delete now goes through useReverificationFlow, like account deletion does.

Part of ORGS-2087
@changeset-bot

changeset-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5dba33e

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

This PR includes changesets to release 3 packages
Name Type
@clerk/mosaic Patch
@clerk/mosaic-docs Patch
@clerk/swingset 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

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Nov 18, 2026 8:24pm UTC
mosaic-docs Ready Ready Preview Nov 18, 2026 8:24pm UTC
swingset Ready Ready Preview Nov 18, 2026 8:24pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Organization deletion in OrganizationProfileDangerSection now runs through useReverificationFlow. The confirmation controller receives the reverification state. A feature test covers the password prompt when verification is required, successful deletion, and navigation to /after-leave. A patch changeset documents the update.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • clerk/javascript#10871: Updates organization deletion in the UI package’s OrganizationProfile to use reverification for the same required-verification response.

Suggested reviewers: ephem, dstaley

Merge Risk: Minimal · up to 5dba3

Organization admins outside the reverification window will now be prompted to reverify before deleting an organization, instead of seeing an error. The change is small and follows the existing account-deletion pattern, and no merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: OrganizationProfile in Mosaic now prompts for reverification before organization deletion. The changeset adds the useReverificationFlow wrapper to the delete action, w…
Description check Passed The description states the problem: the delete action lacks the reverification wrapper, so org admins outside the reverification window get a session_reverification_required error. It explains the fix…
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.
Full details: Title check

Explanation

The title names the main change: OrganizationProfile in Mosaic now prompts for reverification before organization deletion. The changeset adds the useReverificationFlow wrapper to the delete action, which matches the title. The fix prefix is a reasonable type for this bug fix.

Full details: Description check

Explanation

The description states the problem: the delete action lacks the reverification wrapper, so org admins outside the reverification window get a session_reverification_required error. It explains the fix (useReverificationFlow passed to useConfirmController) and the new feature test. This matches the changed danger-section component and its test.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Linked repositories: Some configured repositories could not be included in this review. Cross-repository analysis may be incomplete. Please check linked-repository access and settings.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: clerk/javascript
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 7b347dd
  • Layers: Repository YAML (base), Organization UI (inherited)
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: 0ae62496-c14b-4272-8de2-e07488fa8086
Commits

Reviewing files that changed from the base of the PR and between 7b347dd and 5dba33e.

Files selected for processing: 3

  • .changeset/mosaic-org-delete-reverification.md
  • packages/mosaic/src/features/organization-profile/organization-profile-danger-section/__tests__/organization-profile-danger-section.feature.test.tsx
  • packages/mosaic/src/features/organization-profile/organization-profile-danger-section/organization-profile-danger-section.tsx
Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour.

@blacksmith-sh

blacksmith-sh Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Matches Org delete prompts for reverification

Without this PR the confirm dialog shows a red "Verification required" error; with it the dialog switches to the password prompt and, after the password, the organization is deleted and the page moves to the after-leave URL.

Recording

Watch full video · Original footage · 0:00 Open the delete dialog · 0:07 Confirm the deletion · 0:13 Verify and delete

Merge-base

Confirm dialog

This PR 5dba33e6

Confirm dialog

Proof on 5dba33e6 · mocked: Frontend API (needs NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY) · Did Proof get it right? Yes · No

View full Proof report · React 👎 or comment @codesmith dismiss this proof to dismiss

@pkg-pr-new

pkg-pr-new Bot commented Nov 18, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@10907

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@10907

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@10907

@clerk/expo

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

@clerk/expo-biometrics

npm i https://pkg.pr.new/@clerk/expo-biometrics@10907

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@10907

@clerk/expo-native-components

npm i https://pkg.pr.new/@clerk/expo-native-components@10907

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/mosaic

npm i https://pkg.pr.new/@clerk/mosaic@10907

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 5dba33e

@gabrielmeloc22
gabrielmeloc22 requested review from dstaley and mauricioabreu and removed request for mauricioabreu November 18, 2026 21:13
@gabrielmeloc22
gabrielmeloc22 enabled auto-merge (squash) November 19, 2026 13:01

This branch was successfully deployed

2 active deployments
Preview – swingset — 5dba33e6 Deployed Nov 18, 2026 by vercel[bot]
Preview – clerk-js-sandbox — 5dba33e6 Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant