[PR #5003] [MERGED] fix(org): update type to include undefined #31310

Closed
opened 2026-04-17 22:11:37 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5003
Author: @himself65
Created: 9/30/2025
Status: Merged
Merged: 9/30/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/09/30/org-exact-opitonal


📝 Commits (1)

  • f98efd0 fix(org): update type to include undefined

📊 Changes

4 files changed (+19 additions, -10 deletions)

View changed files

📝 packages/better-auth/src/plugins/organization/routes/crud-access-control.ts (+15 -6)
📝 packages/better-auth/src/plugins/organization/routes/crud-invites.ts (+1 -1)
📝 packages/better-auth/src/plugins/organization/routes/crud-members.ts (+2 -2)
📝 packages/better-auth/src/plugins/organization/routes/crud-org.ts (+1 -1)

📄 Description

Fixes: https://github.com/better-auth/better-auth/issues/4804


Summary by cubic

Update organization route types to correctly treat optional fields as possibly undefined. This fixes TypeScript inference issues and prevents errors when optional values are omitted.

  • Bug Fixes
    • Mark organizationId as string | undefined across access control, invites, members, and organization update.
    • Allow undefined for roleName and permission in updateOrgRole.
    • Mark teamId as string | undefined when teams are enabled in addMember.
    • Add typed metadata query for listOrgRoles with optional organizationId.

🔄 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/5003 **Author:** [@himself65](https://github.com/himself65) **Created:** 9/30/2025 **Status:** ✅ Merged **Merged:** 9/30/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/09/30/org-exact-opitonal` --- ### 📝 Commits (1) - [`f98efd0`](https://github.com/better-auth/better-auth/commit/f98efd0ac4edbdad1e206e7bbb69dd4fcd44cf2c) fix(org): update type to include undefined ### 📊 Changes **4 files changed** (+19 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/organization/routes/crud-access-control.ts` (+15 -6) 📝 `packages/better-auth/src/plugins/organization/routes/crud-invites.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/organization/routes/crud-members.ts` (+2 -2) 📝 `packages/better-auth/src/plugins/organization/routes/crud-org.ts` (+1 -1) </details> ### 📄 Description Fixes: https://github.com/better-auth/better-auth/issues/4804 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Update organization route types to correctly treat optional fields as possibly undefined. This fixes TypeScript inference issues and prevents errors when optional values are omitted. - **Bug Fixes** - Mark organizationId as string | undefined across access control, invites, members, and organization update. - Allow undefined for roleName and permission in updateOrgRole. - Mark teamId as string | undefined when teams are enabled in addMember. - Add typed metadata query for listOrgRoles with optional organizationId. <!-- 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-17 22:11:37 -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#31310