[PR #5214] [MERGED] fix(organization): Certain parameters not showing in client types #5857

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5214
Author: @ping-maxwell
Created: 10/10/2025
Status: Merged
Merged: 10/12/2025
Merged by: @Bekacru

Base: canaryHead: fix/organization/crud-AC-types-not-showing-on-authClient


📝 Commits (3)

  • 251aefa fix(organization): Certain parameters not showing in client types
  • f6b8e50 fix: non-empty str
  • c0586db Merge branch 'canary' into fix/organization/crud-AC-types-not-showing-on-authClient

📊 Changes

1 file changed (+51 additions, -23 deletions)

View changed files

📝 packages/better-auth/src/plugins/organization/routes/crud-access-control.ts (+51 -23)

📄 Description

Union types will not show correctly on the authClient for body/query parameters

closes: https://github.com/better-auth/better-auth/issues/4636
linear: https://linear.app/better-auth/issue/ENG-105/fix-type-for-role-for-update-and-deletion-is-not-properly-inferred-on


Summary by cubic

Fixes client type inference for organization role endpoints by replacing union types with optional roleName/roleId, so parameters show correctly in the authClient. Aligns with Linear ENG-105 by ensuring role identification is properly inferred for update and deletion.

  • Bug Fixes
    • Changed $Infer body/query from unions to optional roleName/roleId across deleteOrgRole, getOrgRole, and updateOrgRole.
    • Switched checks from "in" to presence checks (ctx.body.roleName / ctx.query.roleName) for clarity.
    • Added explicit BAD_REQUEST error and logging when neither roleName nor roleId is provided.
    • Kept organizationId optional and unchanged.

🔄 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/5214 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 10/10/2025 **Status:** ✅ Merged **Merged:** 10/12/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/organization/crud-AC-types-not-showing-on-authClient` --- ### 📝 Commits (3) - [`251aefa`](https://github.com/better-auth/better-auth/commit/251aefa7fec00912d29bd2aa5b3c5debb77034ff) fix(organization): Certain parameters not showing in client types - [`f6b8e50`](https://github.com/better-auth/better-auth/commit/f6b8e50c7f319b94e04a251bb39bb6a37aa5d9e2) fix: non-empty str - [`c0586db`](https://github.com/better-auth/better-auth/commit/c0586db93e9269c5cc5a736ca9ed7fbe6778246b) Merge branch 'canary' into fix/organization/crud-AC-types-not-showing-on-authClient ### 📊 Changes **1 file changed** (+51 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/organization/routes/crud-access-control.ts` (+51 -23) </details> ### 📄 Description Union types will not show correctly on the authClient for body/query parameters closes: https://github.com/better-auth/better-auth/issues/4636 linear: https://linear.app/better-auth/issue/ENG-105/fix-type-for-role-for-update-and-deletion-is-not-properly-inferred-on <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes client type inference for organization role endpoints by replacing union types with optional roleName/roleId, so parameters show correctly in the authClient. Aligns with Linear ENG-105 by ensuring role identification is properly inferred for update and deletion. - **Bug Fixes** - Changed $Infer body/query from unions to optional roleName/roleId across deleteOrgRole, getOrgRole, and updateOrgRole. - Switched checks from `"in"` to presence checks (ctx.body.roleName / ctx.query.roleName) for clarity. - Added explicit BAD_REQUEST error and logging when neither roleName nor roleId is provided. - Kept organizationId optional and unchanged. <!-- 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:39:15 -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#5857