[PR #4544] [CLOSED] fix(organization): beforeCreateOrganization didn't pass new body #5438

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4544
Author: @ping-maxwell
Created: 9/9/2025
Status: Closed

Base: canaryHead: fix/organization/before-create-org-return


📝 Commits (4)

  • 30d1364 fix(organization): beforeCreateOrganization didn't pass new body
  • 7b47920 Merge branch 'canary' into fix/organization/before-create-org-return
  • 6a0d5af Merge branch 'canary' into fix/organization/before-create-org-return
  • e8428a5 change to const

📊 Changes

1 file changed (+6 additions, -1 deletions)

View changed files

📝 packages/better-auth/src/plugins/organization/routes/crud-org.ts (+6 -1)

📄 Description

When the dev returns a value from the beforeCreateOrganization fn, it should then be forwarded to the createOrganization fn. This PR implements such fix.


Summary by cubic

Fixes createOrganization to use the body returned by beforeCreateOrganization so developer changes are applied. Also prevents internal fields from being persisted.

  • Bug Fixes
    • Forward the updated body from beforeCreateOrganization to the adapter.
    • Exclude keepCurrentActiveOrganization and userId from the saved organization data.

🔄 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/4544 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 9/9/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `fix/organization/before-create-org-return` --- ### 📝 Commits (4) - [`30d1364`](https://github.com/better-auth/better-auth/commit/30d1364555787470ad6e7aace44d427110cc9238) fix(organization): `beforeCreateOrganization` didn't pass new body - [`7b47920`](https://github.com/better-auth/better-auth/commit/7b4792048ac5094d0ba517132268935654e35f45) Merge branch 'canary' into fix/organization/before-create-org-return - [`6a0d5af`](https://github.com/better-auth/better-auth/commit/6a0d5af6bc616b28338814265ef0a822645dd447) Merge branch 'canary' into fix/organization/before-create-org-return - [`e8428a5`](https://github.com/better-auth/better-auth/commit/e8428a58d9234000e0a9235acb5361ac6772fe08) change to const ### 📊 Changes **1 file changed** (+6 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/organization/routes/crud-org.ts` (+6 -1) </details> ### 📄 Description When the dev returns a value from the `beforeCreateOrganization` fn, it should then be forwarded to the createOrganization fn. This PR implements such fix. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes createOrganization to use the body returned by beforeCreateOrganization so developer changes are applied. Also prevents internal fields from being persisted. - **Bug Fixes** - Forward the updated body from beforeCreateOrganization to the adapter. - Exclude keepCurrentActiveOrganization and userId from the saved organization data. <!-- 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:22:47 -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#5438