[PR #3593] [CLOSED] fix(organization): allow set active org using slug #21801

Closed
opened 2026-04-15 20:36:47 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3593
Author: @iRoachie
Created: 7/24/2025
Status: Closed

Base: mainHead: fix/set-active-org


📝 Commits (3)

  • 9ef44c3 fix: allow set active org using slug
  • 76dc320 Update packages/better-auth/src/plugins/organization/routes/crud-org.ts
  • 8a56ad7 nit: lint

📊 Changes

2 files changed (+33 additions, -12 deletions)

View changed files

📝 packages/better-auth/src/plugins/organization/adapter.ts (+32 -12)
📝 packages/better-auth/src/plugins/organization/routes/crud-org.ts (+1 -0)

📄 Description

#3497 added a regression where only organizationId could be used for the checkMembership step in setting the active org.

Resolves #3589


Summary by cubic

Fixed a regression so users can now set their active organization using either the organization ID or slug.

  • Bug Fixes
  • Updated membership checks to accept both organizationId and organizationSlug when setting the active organization.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/3593 **Author:** [@iRoachie](https://github.com/iRoachie) **Created:** 7/24/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/set-active-org` --- ### 📝 Commits (3) - [`9ef44c3`](https://github.com/better-auth/better-auth/commit/9ef44c37d2554cf6acaf2150a8941d39ab336181) fix: allow set active org using slug - [`76dc320`](https://github.com/better-auth/better-auth/commit/76dc3204e9de57db11fb1c152969bb21eb865653) Update packages/better-auth/src/plugins/organization/routes/crud-org.ts - [`8a56ad7`](https://github.com/better-auth/better-auth/commit/8a56ad7fc9720763239728f6f77ed2cdfea4d5a3) nit: lint ### 📊 Changes **2 files changed** (+33 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/organization/adapter.ts` (+32 -12) 📝 `packages/better-auth/src/plugins/organization/routes/crud-org.ts` (+1 -0) </details> ### 📄 Description #3497 added a regression where only organizationId could be used for the checkMembership step in setting the active org. Resolves #3589 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixed a regression so users can now set their active organization using either the organization ID or slug. - **Bug Fixes** - Updated membership checks to accept both organizationId and organizationSlug when setting the active organization. <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 20:36:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#21801