[PR #6526] [MERGED] docs: clarify createOrganization behavior regarding userId and session headers #32327

Closed
opened 2026-04-17 23:10:13 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6526
Author: @GautamBytes
Created: 12/4/2025
Status: Merged
Merged: 12/5/2025
Merged by: @Bekacru

Base: canaryHead: docs/clarify-create-org-userid


📝 Commits (2)

  • ce1ae3e docs: clarify createOrganization userId behavior with session headers
  • 91d4ffc Merge branch 'canary' into docs/clarify-create-org-userid

📊 Changes

1 file changed (+12 additions, -2 deletions)

View changed files

📝 docs/content/docs/plugins/organization.mdx (+12 -2)

📄 Description

Description

This PR addresses issue #6524 regarding unexpected behavior in the createOrganization endpoint.

Users observed that passing a userId in the body while also providing session headers resulted in the userId being ignored (the organization was created for the session user instead).

I have updated docs/content/docs/plugins/organization.mdx to:

  1. Update the code comment for userId to flag this behavior immediately.
  2. Add a Callout warning that explicitly states userId and session headers are mutually exclusive.
  3. Provide clear guidance for the "Admin creating for another user" use case (server-side call without headers).

Linked Issue

Closes #6524


Summary by cubic

Clarified createOrganization docs: when session headers are sent, the organization is created for the session user and any userId in the body is ignored. Added a warning that userId and session headers are mutually exclusive, with server-side guidance for admins creating organizations on behalf of other users.

Written for commit 91d4ffca6c. 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/6526 **Author:** [@GautamBytes](https://github.com/GautamBytes) **Created:** 12/4/2025 **Status:** ✅ Merged **Merged:** 12/5/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `docs/clarify-create-org-userid` --- ### 📝 Commits (2) - [`ce1ae3e`](https://github.com/better-auth/better-auth/commit/ce1ae3ea6d12ec8e92e813a84b7ed00710f28f7e) docs: clarify createOrganization userId behavior with session headers - [`91d4ffc`](https://github.com/better-auth/better-auth/commit/91d4ffca6ce993b0e27e5e9190b7148094045ab4) Merge branch 'canary' into docs/clarify-create-org-userid ### 📊 Changes **1 file changed** (+12 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/organization.mdx` (+12 -2) </details> ### 📄 Description ### Description This PR addresses issue #6524 regarding unexpected behavior in the `createOrganization` endpoint. Users observed that passing a `userId` in the body while also providing session headers resulted in the `userId` being ignored (the organization was created for the session user instead). I have updated `docs/content/docs/plugins/organization.mdx` to: 1. Update the code comment for `userId` to flag this behavior immediately. 2. Add a `Callout` warning that explicitly states `userId` and session headers are mutually exclusive. 3. Provide clear guidance for the "Admin creating for another user" use case (server-side call without headers). ### Linked Issue Closes #6524 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Clarified createOrganization docs: when session headers are sent, the organization is created for the session user and any userId in the body is ignored. Added a warning that userId and session headers are mutually exclusive, with server-side guidance for admins creating organizations on behalf of other users. <sup>Written for commit 91d4ffca6ce993b0e27e5e9190b7148094045ab4. 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-17 23:10:14 -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#32327