[PR #5062] feat(organization): explicit organizationId in team endpoints #5749

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5062
Author: @xiaoyu2er
Created: 10/3/2025
Status: 🔄 Open

Base: canaryHead: test/organization-explicit-organizationId


📝 Commits (3)

  • 0229f34 feat: add organizationId in team endpoints
  • 61f3b06 fix: revert
  • 5febc81 Merge branch 'canary' into test/organization-explicit-organizationId

📊 Changes

2 files changed (+187 additions, -17 deletions)

View changed files

📝 packages/better-auth/src/plugins/organization/routes/crud-team.ts (+35 -17)
📝 packages/better-auth/src/plugins/organization/team.test.ts (+152 -0)

📄 Description

Summary by cubic

Enable explicit organizationId for team operations to support multi-org workflows and remove reliance on the active organization. The add/remove team member endpoints now accept organizationId and fall back to the session’s active org when not provided.

  • New Features
    • addTeamMember and removeTeamMember accept an optional organizationId in the request body; errors if neither is provided.
    • All permission checks and queries use the resolved organizationId.
    • OpenAPI/Zod metadata updated to document the new parameter.
    • Tests added for updateTeam with explicit organizationId and for add/remove team member flows using explicit organizationId.

Written for commit 5febc8194076823edfe65bd3b4ecac111c0e66ce. Summary will update on new commits.


🔄 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/5062 **Author:** [@xiaoyu2er](https://github.com/xiaoyu2er) **Created:** 10/3/2025 **Status:** 🔄 Open **Base:** `canary` ← **Head:** `test/organization-explicit-organizationId` --- ### 📝 Commits (3) - [`0229f34`](https://github.com/better-auth/better-auth/commit/0229f349c245beed10c5e5aa89d7d2a547fbfe15) feat: add organizationId in team endpoints - [`61f3b06`](https://github.com/better-auth/better-auth/commit/61f3b06cec9c355c02c09af10979c98140557bc3) fix: revert - [`5febc81`](https://github.com/better-auth/better-auth/commit/5febc8194076823edfe65bd3b4ecac111c0e66ce) Merge branch 'canary' into test/organization-explicit-organizationId ### 📊 Changes **2 files changed** (+187 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/organization/routes/crud-team.ts` (+35 -17) 📝 `packages/better-auth/src/plugins/organization/team.test.ts` (+152 -0) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Enable explicit organizationId for team operations to support multi-org workflows and remove reliance on the active organization. The add/remove team member endpoints now accept organizationId and fall back to the session’s active org when not provided. - **New Features** - addTeamMember and removeTeamMember accept an optional organizationId in the request body; errors if neither is provided. - All permission checks and queries use the resolved organizationId. - OpenAPI/Zod metadata updated to document the new parameter. - Tests added for updateTeam with explicit organizationId and for add/remove team member flows using explicit organizationId. <sup>Written for commit 5febc8194076823edfe65bd3b4ecac111c0e66ce. Summary will update on new commits.</sup> <!-- 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:34: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#5749