[PR #5337] [MERGED] fix(organization): compatibility with exactOptionalPropertyTypes #5938

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5337
Author: @himself65
Created: 10/15/2025
Status: Merged
Merged: 10/15/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/10/15/type-fix


📝 Commits (2)

  • 75409cb fix(organization): compatibility with exactOptionalPropertyTypes
  • 722d9f9 chore: fix

📊 Changes

2 files changed (+18 additions, -9 deletions)

View changed files

e2e/smoke/test/fixtures/tsconfig-exact-optional-property-types/src/organization.ts (+18 -0)
📝 packages/better-auth/src/plugins/organization/routes/crud-access-control.ts (+0 -9)

📄 Description

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


Summary by cubic

Make the organization plugin compatible with TypeScript’s exactOptionalPropertyTypes. Prevents type errors by making the inferred query type always an object; adds a smoke test to guard the behavior.

  • Bug Fixes
    • Set metadata.$Infer.query to an object with optional organizationId (no undefined union).
    • Added an e2e smoke fixture with exactOptionalPropertyTypes enabled.

🔄 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/5337 **Author:** [@himself65](https://github.com/himself65) **Created:** 10/15/2025 **Status:** ✅ Merged **Merged:** 10/15/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/10/15/type-fix` --- ### 📝 Commits (2) - [`75409cb`](https://github.com/better-auth/better-auth/commit/75409cb3587ea2a228eca422b2ea0bff2efc2ccc) fix(organization): compatibility with `exactOptionalPropertyTypes` - [`722d9f9`](https://github.com/better-auth/better-auth/commit/722d9f976f0b819c7da2aa141364e7699d933bbe) chore: fix ### 📊 Changes **2 files changed** (+18 additions, -9 deletions) <details> <summary>View changed files</summary> ➕ `e2e/smoke/test/fixtures/tsconfig-exact-optional-property-types/src/organization.ts` (+18 -0) 📝 `packages/better-auth/src/plugins/organization/routes/crud-access-control.ts` (+0 -9) </details> ### 📄 Description Fixes: https://github.com/better-auth/better-auth/issues/5119 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Make the organization plugin compatible with TypeScript’s exactOptionalPropertyTypes. Prevents type errors by making the inferred query type always an object; adds a smoke test to guard the behavior. - **Bug Fixes** - Set metadata.$Infer.query to an object with optional organizationId (no undefined union). - Added an e2e smoke fixture with exactOptionalPropertyTypes enabled. <!-- 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:41:57 -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#5938