-
Notifications
You must be signed in to change notification settings - Fork 402
chore(clerk-js,types): Hide personal workspace options when organization selection is enforced #5391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(clerk-js,types): Hide personal workspace options when organization selection is enforced #5391
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 21a931c The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 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 |
1bd1e9d to
8543336
Compare
| skipInvitationScreen: ctx.skipInvitationScreen || false, | ||
| hideSlug: ctx.hideSlug || false, | ||
| hidePersonal: ctx.hidePersonal || false, | ||
| hidePersonal: organizationSettings.forceOrganizationSelection || ctx.hidePersonal || false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we deprecate this prop once the feature releases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there could still be cases for developers to pass hidePersonal even without having force_organization_selection configured on the instance
I'd like to make this change later based on some data if possible, if we could push telemetry data for organization components usage with hidePersonal and also send force_organization_selection value along
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense! Let's add it to the project as a discussion topic so we don't forget. I agree that there might be cases where someone could take advantage of it, but if we have the opportunity to remove options in favor of our recommended approach that would be good 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the prop always have priority over the env var ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's say the developer currently uses hidePersonal=false on the application, and then enables force an org in the Clerk Dashboard.
The expected behavior is to hide personal workspace across all org components. Especially for the after-auth flow, because if it gets displayed, then it'd lead to a bug or the user could select a personal workspace and get stuck with a pending session.
| skipInvitationScreen: ctx.skipInvitationScreen || false, | ||
| hideSlug: ctx.hideSlug || false, | ||
| hidePersonal: ctx.hidePersonal || false, | ||
| hidePersonal: organizationSettings.forceOrganizationSelection || ctx.hidePersonal || false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the prop always have priority over the env var ?
packages/clerk-js/src/ui/contexts/components/OrganizationSwitcher.ts
Outdated
Show resolved
Hide resolved
f33cc01 to
21a931c
Compare
21a931c to
310307d
Compare
…ion selection is enforced (#5391)
Description
Resolves ORGS-537
Introduces
force_organization_selectionon environment settings. When enabled, all organization components should hide the "personal workspace" options.This is also important for the after-auth flow with
force_organization_selection, to avoid displaying the option to select a personal account onOrganizationList, and to also not display "Personal Workspace" onOrganizationSwitcherChecklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change