[PR #3731] [MERGED] fix(organization): some endpoints do not return additional fields #13225

Closed
opened 2026-04-13 08:49:55 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3731
Author: @ping-maxwell
Created: 8/1/2025
Status: Merged
Merged: 11/10/2025
Merged by: @Bekacru

Base: canaryHead: fix/org/return-additional-fields


📝 Commits (10+)

📊 Changes

10 files changed (+722 additions, -194 deletions)

View changed files

📝 packages/better-auth/src/client/query.ts (+2 -2)
📝 packages/better-auth/src/plugins/organization/adapter.ts (+43 -37)
📝 packages/better-auth/src/plugins/organization/client.ts (+16 -24)
📝 packages/better-auth/src/plugins/organization/organization.test.ts (+559 -43)
📝 packages/better-auth/src/plugins/organization/organization.ts (+1 -16)
📝 packages/better-auth/src/plugins/organization/routes/crud-invites.ts (+8 -7)
📝 packages/better-auth/src/plugins/organization/routes/crud-members.ts (+10 -6)
📝 packages/better-auth/src/plugins/organization/routes/crud-org.ts (+22 -15)
📝 packages/better-auth/src/plugins/organization/schema.ts (+52 -33)
📝 packages/better-auth/src/plugins/organization/types.ts (+9 -11)

📄 Description

closes https://github.com/better-auth/better-auth/issues/3686
linear: https://linear.app/better-auth/issue/ENG-131/fix-ensure-organization-additionalfields-are-returned-and-inferred-in


Summary by cubic

Ensures organization endpoints and client hooks include and correctly infer additional fields for organizations, members, teams, and invitations with client/server-safe typing. Addresses Linear ENG-131.

  • Bug Fixes
    • Unified responses and types to include additional fields across endpoints and hooks (including nested members/teams/invitations), while keeping hidden fields typed but not exposed to clients.
    • Fixed role parsing and team inference; improved SSR detection in useAuthQuery to avoid server-side fetches.

Written for commit c343970431. Summary will update automatically 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/3731 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 8/1/2025 **Status:** ✅ Merged **Merged:** 11/10/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/org/return-additional-fields` --- ### 📝 Commits (10+) - [`a3dcc27`](https://github.com/better-auth/better-auth/commit/a3dcc270a3cac03e268d7677a6c8587ceca22e8e) fix - [`4b2b8ad`](https://github.com/better-auth/better-auth/commit/4b2b8ad54b1eed6a785dd5ae1b665488d9273a6f) Merge branch 'main' into fix/org/return-additional-fields - [`b34fdf1`](https://github.com/better-auth/better-auth/commit/b34fdf16ef5e334b92ddc0a139b47b62883efb35) chore: typo + changeset - [`7b04eef`](https://github.com/better-auth/better-auth/commit/7b04eefac4f20734ef2c73676f995315f6ce0ec7) Merge branch 'fix/org/return-additional-fields' of https://github.com/ping-maxwell/better-auth into fix/org/return-additional-fields - [`70e78c3`](https://github.com/better-auth/better-auth/commit/70e78c36f1038ced7c1b3f94faec18c8db792ffc) fix team inference in client get-action - [`73657ed`](https://github.com/better-auth/better-auth/commit/73657ed94b042886c1a30f3630f5bcac0c595466) fix: type issues - [`5afe826`](https://github.com/better-auth/better-auth/commit/5afe826904fc0c7b516b20d6889d534eb89ac945) chore: lint - [`05914e5`](https://github.com/better-auth/better-auth/commit/05914e5399b456605957305e435970bd9b61ce66) Merge branch 'main' into fix/org/return-additional-fields - [`3fb889a`](https://github.com/better-auth/better-auth/commit/3fb889a885d168a615b89836bdce6e3cc272babc) fix - [`5e93b6f`](https://github.com/better-auth/better-auth/commit/5e93b6ffd92ad1e2e17feb65f48cd1e5d46a015b) fix: remove as string from `role`s ### 📊 Changes **10 files changed** (+722 additions, -194 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/client/query.ts` (+2 -2) 📝 `packages/better-auth/src/plugins/organization/adapter.ts` (+43 -37) 📝 `packages/better-auth/src/plugins/organization/client.ts` (+16 -24) 📝 `packages/better-auth/src/plugins/organization/organization.test.ts` (+559 -43) 📝 `packages/better-auth/src/plugins/organization/organization.ts` (+1 -16) 📝 `packages/better-auth/src/plugins/organization/routes/crud-invites.ts` (+8 -7) 📝 `packages/better-auth/src/plugins/organization/routes/crud-members.ts` (+10 -6) 📝 `packages/better-auth/src/plugins/organization/routes/crud-org.ts` (+22 -15) 📝 `packages/better-auth/src/plugins/organization/schema.ts` (+52 -33) 📝 `packages/better-auth/src/plugins/organization/types.ts` (+9 -11) </details> ### 📄 Description closes https://github.com/better-auth/better-auth/issues/3686 linear: https://linear.app/better-auth/issue/ENG-131/fix-ensure-organization-additionalfields-are-returned-and-inferred-in <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Ensures organization endpoints and client hooks include and correctly infer additional fields for organizations, members, teams, and invitations with client/server-safe typing. Addresses Linear ENG-131. - **Bug Fixes** - Unified responses and types to include additional fields across endpoints and hooks (including nested members/teams/invitations), while keeping hidden fields typed but not exposed to clients. - Fixed role parsing and team inference; improved SSR detection in useAuthQuery to avoid server-side fetches. <sup>Written for commit c343970431d078d0d6f0db2ac9118bb87b0e8000. Summary will update automatically 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-04-13 08:49: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#13225