feat(clerk-js,ui): exclusive membership — show only exclusive org in switcher/list/chooser#8932
feat(clerk-js,ui): exclusive membership — show only exclusive org in switcher/list/chooser#8932NicolasLopes7 wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: c4e689c The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited) Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@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: |
87781d5 to
d19de66
Compare
… surfaces, derive from full membership set
What
When a user belongs to an organization with
exclusive_membership = true, the org switcher / org list / choose-org task now display only that exclusive org — the personal account/workspace and all non-exclusive orgs are hidden. Users with no exclusive memberships see no change.Why
Enterprise orgs (first ask: OpenRouter) want members locked to the company workspace — no personal account, no other orgs. Backend enforces the lock via the
choose-organizationsession task recomputed every token mint; this PR is the UX polish that keeps the frontend from offering options the backend will reject.Changes
Membership flag plumbing —
exclusiveMembershipdid not exist anywhere in JS:@clerk/shared—OrganizationMembershipJSON.exclusive_membership(wire) +OrganizationMembershipResource.exclusiveMembership(type). Snapshot type inherits via alias.@clerk/clerk-js—OrganizationMembershipresource: field +fromJSON(?? false) +__internal_toSnapshot.Display filter —
@clerk/ui:filterExclusiveMemberships(memberships) → { memberships, hasExclusive }. If any membership is exclusive, return only exclusive ones and signal callers to hide personal.OrganizationSwitcher,OrganizationList, andTaskChooseOrganization/ChooseOrganizationScreen.Changeset:
minorfor@clerk/clerk-js,@clerk/shared,@clerk/ui.