[PR #6023] [MERGED] fix(organization): activeOrgId no longer inferred after enabling dynamic AC #23291

Closed
opened 2026-04-15 21:36:24 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6023
Author: @ping-maxwell
Created: 11/16/2025
Status: Merged
Merged: 11/16/2025
Merged by: @Bekacru

Base: canaryHead: fix/organization-activeOrgId-no-longer-inferred-after-enabling-dynamic-AC


📝 Commits (2)

  • f6f21e0 fix(organization): activeOrganizationId no longer inferred after enabling dynamic AC
  • 67e1ac2 Merge branch 'canary' into fix/organization-activeOrgId-no-longer-inferred-after-enabling-dynamic-AC

📊 Changes

1 file changed (+8 additions, -0 deletions)

View changed files

📝 packages/better-auth/src/plugins/organization/schema.ts (+8 -0)

📄 Description

The activeOrganizationId on the session model is no longer inferrable from the Session type after enabling dynamic access control. This PR fixes this.

issue: https://github.com/better-auth/better-auth/issues/5909
linear: https://linear.app/better-auth/issue/ENG-738/fix-activeorganizationid-not-inferred-after-enabling


Summary by cubic

Restores TypeScript inference for session.activeOrganizationId when dynamic access control is enabled. Prevents the field from disappearing on the Session type.

  • Bug Fixes
    • Updated OrganizationSchema to include session fields via InferSchema, ensuring activeOrganizationId is correctly inferred in Session.

Written for commit 67e1ac2def. 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/6023 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 11/16/2025 **Status:** ✅ Merged **Merged:** 11/16/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/organization-activeOrgId-no-longer-inferred-after-enabling-dynamic-AC` --- ### 📝 Commits (2) - [`f6f21e0`](https://github.com/better-auth/better-auth/commit/f6f21e064b7297d8e8879e561a9d71d62a00d3bc) fix(organization): `activeOrganizationId` no longer inferred after enabling dynamic AC - [`67e1ac2`](https://github.com/better-auth/better-auth/commit/67e1ac2def001e10d3d904792286cb85138264ec) Merge branch 'canary' into fix/organization-activeOrgId-no-longer-inferred-after-enabling-dynamic-AC ### 📊 Changes **1 file changed** (+8 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/organization/schema.ts` (+8 -0) </details> ### 📄 Description The `activeOrganizationId` on the session model is no longer inferrable from the `Session` type after enabling dynamic access control. This PR fixes this. issue: https://github.com/better-auth/better-auth/issues/5909 linear: https://linear.app/better-auth/issue/ENG-738/fix-activeorganizationid-not-inferred-after-enabling <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Restores TypeScript inference for session.activeOrganizationId when dynamic access control is enabled. Prevents the field from disappearing on the Session type. - **Bug Fixes** - Updated OrganizationSchema to include session fields via InferSchema, ensuring activeOrganizationId is correctly inferred in Session. <sup>Written for commit 67e1ac2def001e10d3d904792286cb85138264ec. 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-15 21:36:24 -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#23291