feat(clerk-js): Backport exclusive-membership auto-activate for Core 2#8943
Conversation
When the choose-organization session task fires for a member of an exclusive-membership organization, clerk-js now skips the org picker and auto-activates that organization (single-fire setActive, error fallback to the normal flows). Exposes Organization.exclusiveMembership on the resource. Backport of #8933 to the Core 2 (v5) line. Adapts to Core 2 APIs: the SetActiveNavigate callback receives only { session } (no decorateUrl), and exclusiveMembership is anchored next to maxAllowedMemberships since selfServeSSOEnabled does not exist on Core 2.
🦋 Changeset detectedLatest commit: d28e3a3 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/elements
@clerk/clerk-expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/clerk-react
@clerk/react-router
@clerk/remix
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/themes
@clerk/types
@clerk/upgrade
@clerk/vue
commit: |
29b2180 to
6b35346
Compare
6b35346 to
770c003
Compare
770c003 to
b5b298d
Compare
The exclusive-membership auto-activate backport tips clerk.js past the 931KB bundlewatch ceiling (931.01KB). Bump clerk.js to 934KB and clerk.legacy.browser.js to 132KB to restore headroom.
b5b298d to
d28e3a3
Compare
What
Backport of #8933 to the Core 2 (v5) line (
release/core-2).When the
choose-organizationsession task fires for a member of an exclusive-membership organization, clerk-js now skips the org picker entirely: it shows the loading spinner and auto-callssetActiveon that org (single-fire viauseRef). On failure it surfaces the error and falls back to the normal choose/create flows. Non-exclusive members: zero change.This brings the clerk-js half of exclusive-membership "after-auth" to customers still on the v5 / Core 2 line.
Changes
Organization.exclusiveMembership— parse the FAPIexclusive_membershipfield (@clerk/sharedtypes +clerk-jsOrganization resourcefromJSON/__internal_toSnapshot).undefinedfor non-adopting instances.TaskChooseOrganization— detect the membership whoseorganization.exclusiveMembership === true, render only the spinner and auto-setActiveonce, reusing the existingnavigateOnSetActive/redirectUrlCompletewiring.Core 2 adaptations (vs. the main/Core 3 original)
clerk-js/src/uion Core 2 (not the separate@clerk/uipackage).SetActiveNavigatecallback receives only{ session }on Core 2 —decorateUrlwas added in Core 3, so it's dropped from thenavigatewiring.exclusiveMembershipis anchored next tomaxAllowedMemberships/adminDeleteEnabledsinceselfServeSSOEnableddoes not exist on Core 2.Notes
@clerk/clerk-jsand@clerk/shared(minor). No@clerk/ui(Core 3 only).release/core-2— do not retarget tomain.