Skip to content

feat(mosaic): Let users grant OAuth consent to up to 5 organizations - #10970

Open
alexcarpenter wants to merge 5 commits into
mainfrom
carp/ui-oauth-consent-orgs-5-enable
Open

alexcarpenter wants to merge 5 commits into
mainfrom
carp/ui-oauth-consent-orgs-5-enable

Conversation

@alexcarpenter

@alexcarpenter alexcarpenter commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Description

OAuthConsent lets users grant access to more than one organization, matching @clerk/ui (#10994). Instances that allow one organization keep today's single-organization select.

The "grants access for every organization the user picks" integration test needs an instance that allows several organizations (clerk/clerk_go#24504 and the oauth_multi_organization_consent flag).

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:

@vercel

vercel Bot commented Nov 24, 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 25, 2026 10:20pm UTC
mosaic-docs Ready Ready Preview Nov 25, 2026 10:20pm UTC
swingset Ready Ready Preview Nov 25, 2026 10:20pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f82aa16

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 Minor
@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

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The ready OAuth consent model now provides a validated maxOrganizations value. The controller uses that value to choose single- or multiple-organization selection and set the multiple-selection limit. Tests cover fallback limits, disabled choices at the limit, membership changes, selection order, and submission of selected organization IDs. Story fixtures and documentation describe the consent-based selection behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: austincalvelage

Merge Risk: Minimal · up to f82aa

OAuth consent now lets users grant access to several organizations, up to the instance's limit, and keeps the single select for instances that allow one. No merge-blocking defect was found in the changed logic. The eager bundle exceeds its size budget by about 50 bytes, which should be resolved or accepted before merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: OAuth consent in @clerk/mosaic now lets users grant access to up to 5 organizations. The changeset, controller, model, types, and tests all support this. The title is…
Description check Passed The description explains that OAuthConsent now lets users grant access to more than one organization, that single-organization instances keep the existing select, and that an integration test needs a …
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 states the main change: OAuth consent in @clerk/mosaic now lets users grant access to up to 5 organizations. The changeset, controller, model, types, and tests all support this. The title is specific and matches the primary feature. Minor note: the title uses 'Let users grant' and 'up to 5', which matches the max_organizations behavior in the summaries.

Full details: Description check

Explanation

The description explains that OAuthConsent now lets users grant access to more than one organization, that single-organization instances keep the existing select, and that an integration test needs a multi-organization instance flag. This relates directly to the changeset. The checklist is unchecked for pnpm test and pnpm build, but the description is still related to the changes.

Finishing Touches

Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Linked repositories: This review skipped 6 repositories. Cross-repository analysis may be incomplete. Check linked repository access and settings.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between f0845b3 and f82aa16.

Files selected for processing: 3

  • .changeset/oauth-consent-multiple-organizations.md
  • packages/mosaic/src/features/oauth-consent/__tests__/oauth-consent.feature.test.tsx
  • packages/mosaic/src/features/oauth-consent/oauth-consent.controller.ts
Linked repositories identified

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

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

@pkg-pr-new

pkg-pr-new Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

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

@clerk/electron-passkeys

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

@clerk/eslint-plugin

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

@clerk/expo

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

@clerk/expo-biometrics

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

@clerk/expo-google-signin

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

@clerk/expo-native-components

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/mosaic

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: f82aa16

@blacksmith-sh

blacksmith-sh Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Matches Consent screen lets the user pick up to the limit of organizations

Tested on 18e0ce8c — In the Default story, picking My workspace after Globex posted 'org_1 org_2', default first. In the multi-organization story, Stark Industries and Wayne Enterprises were disabled at 5 picks, and Allow posted 'org_1 org_2 org_3 org_4 org_5'.

Recording

Watch full video · Original footage · 0:00 Re-pick the default organization last · 0:03 Allow posts the default first · 0:05 Pick up to the limit of 5 · 0:11 Allow posts all five

Rest disabled at limit

Also checked · 4 match

Matches Default consent story switches from single to multi-select
Matches Missing or invalid limit keeps the one-organization select
Matches SingleOrganization story still shows a plain select
Matches Posted organizations put the default first and drop stale memberships

Proof on f82aa161 (from f0845b3d) · mocked: Clerk Frontend API (needs NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY, CLERK_SECRET_KEY) · Did Proof get it right? Yes · No

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

This branch was successfully deployed

2 active deployments
Preview – swingset — f82aa161 Deployed Nov 25, 2026 by vercel[bot]
Preview – clerk-js-sandbox — f82aa161 Deployed Nov 25, 2026 by vercel[bot]
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.

1 participant