[PR #1792] [MERGED] fix(organization): Fix multiple role array not referenced properly #3996

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/1792
Author: @Netrifier
Created: 3/12/2025
Status: Merged
Merged: 3/13/2025
Merged by: @Bekacru

Base: mainHead: fix-organization-multiple-role-array


📝 Commits (3)

  • a72ebb9 fix(organization): Fix multiple role array not referenced properly
  • ec74b5d test(organization): Add tests for multiple roles array
  • 223b04c docs(organization): Update addMember to show array for multiple roles

📊 Changes

5 files changed (+80 additions, -18 deletions)

View changed files

📝 docs/content/docs/plugins/organization.mdx (+1 -1)
📝 packages/better-auth/src/plugins/organization/organization.test.ts (+42 -0)
📝 packages/better-auth/src/plugins/organization/organization.ts (+4 -0)
📝 packages/better-auth/src/plugins/organization/routes/crud-invites.ts (+19 -9)
📝 packages/better-auth/src/plugins/organization/routes/crud-members.ts (+14 -8)

📄 Description

  • Added ability to pass multiple roles as array to addMember in addition to string roles
  • Changed role type to InferRolesFromOption<O> | InferRolesFromOption<O>[] to stop typescript errors when using array with role.
  • Add tests to check multiple roles with addMember and inviteMember
    image
    image
    image
  • Updated docs

Breaking Changes: None


🔄 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/1792 **Author:** [@Netrifier](https://github.com/Netrifier) **Created:** 3/12/2025 **Status:** ✅ Merged **Merged:** 3/13/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `fix-organization-multiple-role-array` --- ### 📝 Commits (3) - [`a72ebb9`](https://github.com/better-auth/better-auth/commit/a72ebb9fb8d69d97b46a5ff27f30336063f853b2) fix(organization): Fix multiple role array not referenced properly - [`ec74b5d`](https://github.com/better-auth/better-auth/commit/ec74b5d340ff6fed1f5c99d65bbf0a83c69f1cb9) test(organization): Add tests for multiple roles array - [`223b04c`](https://github.com/better-auth/better-auth/commit/223b04c89cdf266614e87e117ea32e0337a7bfeb) docs(organization): Update addMember to show array for multiple roles ### 📊 Changes **5 files changed** (+80 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/organization.mdx` (+1 -1) 📝 `packages/better-auth/src/plugins/organization/organization.test.ts` (+42 -0) 📝 `packages/better-auth/src/plugins/organization/organization.ts` (+4 -0) 📝 `packages/better-auth/src/plugins/organization/routes/crud-invites.ts` (+19 -9) 📝 `packages/better-auth/src/plugins/organization/routes/crud-members.ts` (+14 -8) </details> ### 📄 Description - Added ability to pass multiple roles as array to addMember in addition to string roles - Changed role type to `InferRolesFromOption<O> | InferRolesFromOption<O>[]` to stop typescript errors when using array with role. - Add tests to check multiple roles with `addMember` and `inviteMember` ![image](https://github.com/user-attachments/assets/a57d3930-d192-4245-bb19-e563023db15e) ![image](https://github.com/user-attachments/assets/732e3c98-cb25-44f8-b2ab-304755eb0c0a) ![image](https://github.com/user-attachments/assets/5a6de112-3863-4a9c-a395-fe5a82147e02) - Updated docs Breaking Changes: None --- <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 11:27:12 -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#3996