[PR #4276] [MERGED] fix: member not exist on org #5286

Closed
opened 2026-03-13 12:16:55 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4276
Author: @himself65
Created: 8/27/2025
Status: Merged
Merged: 8/27/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/08/27/fix-delete


📝 Commits (1)

  • b68d981 fix: member not exist on org

📊 Changes

2 files changed (+40 additions, -6 deletions)

View changed files

📝 packages/better-auth/src/plugins/organization/organization.test.ts (+37 -0)
📝 packages/better-auth/src/plugins/organization/routes/crud-org.ts (+3 -6)

📄 Description

Fixes: https://github.com/better-auth/better-auth/issues/4261

Summary by cubic

Fixes org deletion to return BAD_REQUEST (400) with a standardized APIError when a non-member tries to delete an organization. Adds a test to cover this case.

  • Bug Fixes
    • Throw APIError with USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION when no membership is found in deleteOrganization.
    • Added test: non-member delete attempt returns 400 with the expected error code.

🔄 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/4276 **Author:** [@himself65](https://github.com/himself65) **Created:** 8/27/2025 **Status:** ✅ Merged **Merged:** 8/27/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/08/27/fix-delete` --- ### 📝 Commits (1) - [`b68d981`](https://github.com/better-auth/better-auth/commit/b68d981d98909e7c020f3b0f1552eb4dd33e30f2) fix: member not exist on org ### 📊 Changes **2 files changed** (+40 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/organization/organization.test.ts` (+37 -0) 📝 `packages/better-auth/src/plugins/organization/routes/crud-org.ts` (+3 -6) </details> ### 📄 Description Fixes: https://github.com/better-auth/better-auth/issues/4261 <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Fixes org deletion to return BAD_REQUEST (400) with a standardized APIError when a non-member tries to delete an organization. Adds a test to cover this case. - **Bug Fixes** - Throw APIError with USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION when no membership is found in deleteOrganization. - Added test: non-member delete attempt returns 400 with the expected error code. <!-- 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-03-13 12:16:55 -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#5286