Skip to content

fix(clerk-js): Do not allow setActive({ organization: null }) when organization selection is forced #6073

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LauraBeatris
Copy link
Member

@LauraBeatris LauraBeatris commented Jun 5, 2025

Description

Resolves ORGS-682

Disclaimer: We're also going to apply protections on the API side, this is just an additional guard.

Introduces an error guard not to allow calling setActive({ organization: null }) when organization selection is forced on the instance settings.

The same handling should be made when we refactor setActive to setCurrent 👀

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:

@LauraBeatris LauraBeatris self-assigned this Jun 5, 2025
Copy link

changeset-bot bot commented Jun 5, 2025

🦋 Changeset detected

Latest commit: 5dd6089

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

This PR includes changesets to release 3 packages
Name Type
@clerk/clerk-js Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo 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

Copy link

vercel bot commented Jun 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2025 9:50pm

@LauraBeatris LauraBeatris force-pushed the laura/do-not-allow-org-null-for-force-org branch from aa47320 to b24bfad Compare June 5, 2025 21:34
@LauraBeatris LauraBeatris marked this pull request as ready for review June 5, 2025 21:35
@LauraBeatris LauraBeatris force-pushed the laura/do-not-allow-org-null-for-force-org branch from b24bfad to 4a473d9 Compare June 5, 2025 21:35
@LauraBeatris LauraBeatris requested a review from a team June 5, 2025 21:36
Copy link

pkg-pr-new bot commented Jun 5, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@6073

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@6073

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@6073

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@6073

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@6073

@clerk/types

npm i https://pkg.pr.new/@clerk/types@6073

@clerk/upgrade

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

@clerk/vue

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

commit: c6cf838

@LauraBeatris LauraBeatris force-pushed the laura/do-not-allow-org-null-for-force-org branch from 4a473d9 to c6cf838 Compare June 5, 2025 21:44
@LauraBeatris LauraBeatris marked this pull request as draft June 5, 2025 23:00
@LauraBeatris
Copy link
Member Author

Some integration tests started to fail after introducing this guard, so I'll deeper tomorrow while also adding error handling on FAPI side.

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.

2 participants