[PR #3932] [MERGED] Add organization membership check before updating member role #5094

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3932
Author: @max-om
Created: 8/11/2025
Status: Merged
Merged: 8/11/2025
Merged by: @Bekacru

Base: canaryHead: crud-members-patch


📝 Commits (4)

  • 01e5f80 Add organization membership check before updating member role
  • 3efc67c Fix lint error
  • 60859a3 Merge branch 'canary' into crud-members-patch
  • 35b2334 add test

📊 Changes

2 files changed (+131 additions, -0 deletions)

View changed files

📝 packages/better-auth/src/plugins/organization/routes/crud-members.test.ts (+121 -0)
📝 packages/better-auth/src/plugins/organization/routes/crud-members.ts (+10 -0)

📄 Description

closes #3933

Summary by cubic

Added a check to ensure a member belongs to the organization before allowing their role to be updated. This prevents unauthorized role changes for users outside the 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/3932 **Author:** [@max-om](https://github.com/max-om) **Created:** 8/11/2025 **Status:** ✅ Merged **Merged:** 8/11/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `crud-members-patch` --- ### 📝 Commits (4) - [`01e5f80`](https://github.com/better-auth/better-auth/commit/01e5f8098f32331abf32a4a244f7c87d065c3a85) Add organization membership check before updating member role - [`3efc67c`](https://github.com/better-auth/better-auth/commit/3efc67cefbe0cb2cfe91784886c55196cca8da4a) Fix lint error - [`60859a3`](https://github.com/better-auth/better-auth/commit/60859a3dcba4b17bb2eb0384082c67cb79bcadb4) Merge branch 'canary' into crud-members-patch - [`35b2334`](https://github.com/better-auth/better-auth/commit/35b233481bc1f48d0c91657e29c8e180618c22bb) add test ### 📊 Changes **2 files changed** (+131 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/organization/routes/crud-members.test.ts` (+121 -0) 📝 `packages/better-auth/src/plugins/organization/routes/crud-members.ts` (+10 -0) </details> ### 📄 Description closes #3933 <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Added a check to ensure a member belongs to the organization before allowing their role to be updated. This prevents unauthorized role changes for users outside the 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-03-13 12:10:34 -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#5094