[PR #3827] [CLOSED] Remove session middleware from Organization Slug Check. #5030

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3827
Author: @emersonlaurentino
Created: 8/6/2025
Status: Closed

Base: canaryHead: patch-1


📝 Commits (1)

📊 Changes

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

View changed files

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

📄 Description

In some cases we want to create a organization in signup moment, so we need to check the slug availabe and for some reason it's authenticated, but it shouldn't.

Don't have any reason for it be authenticated route once the response is just a boolean.


This pull request makes a minor update to the organization routes by removing the unnecessary requestOnlySessionMiddleware from the middleware stack in the checkOrganizationSlug route. This simplifies the middleware usage and ensures only the required organization middleware is applied.

  • Middleware simplification:
    • Removed requestOnlySessionMiddleware from the use array in the checkOrganizationSlug route, leaving only orgMiddleware to be used.
    • Cleaned up the import statement to remove the unused requestOnlySessionMiddleware.

Summary by cubic

Removed session middleware from the organization slug check route so it no longer requires authentication for slug availability checks.

  • Refactors
  • Simplified middleware by removing requestOnlySessionMiddleware and cleaning up imports.

🔄 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/3827 **Author:** [@emersonlaurentino](https://github.com/emersonlaurentino) **Created:** 8/6/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`2f557b4`](https://github.com/better-auth/better-auth/commit/2f557b47c49779178924fe0ed297e4fed2ede550) Update crud-org.ts ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/organization/routes/crud-org.ts` (+2 -2) </details> ### 📄 Description In some cases we want to create a organization in signup moment, so we need to check the slug availabe and for some reason it's authenticated, but it shouldn't. Don't have any reason for it be authenticated route once the response is just a boolean. --- This pull request makes a minor update to the organization routes by removing the unnecessary `requestOnlySessionMiddleware` from the middleware stack in the `checkOrganizationSlug` route. This simplifies the middleware usage and ensures only the required organization middleware is applied. - Middleware simplification: * Removed `requestOnlySessionMiddleware` from the `use` array in the `checkOrganizationSlug` route, leaving only `orgMiddleware` to be used. * Cleaned up the import statement to remove the unused `requestOnlySessionMiddleware`. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Removed session middleware from the organization slug check route so it no longer requires authentication for slug availability checks. - **Refactors** - Simplified middleware by removing requestOnlySessionMiddleware and cleaning up imports. <!-- 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:08:35 -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#5030