[PR #5955] feat(organization): slug optional #6347

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5955
Author: @dvanmali
Created: 11/13/2025
Status: 🔄 Open

Base: canaryHead: slugOptional


📝 Commits (4)

  • cc5e7b1 feat: organization slug optional
  • 66484d7 feat: add tests
  • b24d5a6 docs: update docs to indicate slug is optional
  • 7d511d9 fix: slug optional on prisma snapshot

📊 Changes

6 files changed (+25 additions, -22 deletions)

View changed files

📝 docs/content/docs/plugins/organization.mdx (+2 -1)
📝 packages/better-auth/src/plugins/organization/organization.test.ts (+9 -9)
📝 packages/better-auth/src/plugins/organization/organization.ts (+1 -1)
📝 packages/better-auth/src/plugins/organization/routes/crud-org.ts (+10 -8)
📝 packages/better-auth/src/plugins/organization/schema.ts (+2 -2)
📝 packages/cli/test/__snapshots__/schema-mysql-custom.prisma (+1 -1)

📄 Description

Enables organizations to be created without a slug. Continues to check slug when provided. Organizations may simply utilize the organization id if needed for URLs.

Closes
#6662


Summary by cubic

Organizations can now be created without a slug. Slug uniqueness is only checked when provided, and docs/types/schema mark slug as optional.

  • Migration
    • Make slug optional/nullable in your database and API responses.
    • Use organization id for URLs when no slug is set.

Written for commit 7d511d9340. Summary will update 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/5955 **Author:** [@dvanmali](https://github.com/dvanmali) **Created:** 11/13/2025 **Status:** 🔄 Open **Base:** `canary` ← **Head:** `slugOptional` --- ### 📝 Commits (4) - [`cc5e7b1`](https://github.com/better-auth/better-auth/commit/cc5e7b11941a729669ea69c8199151b7c7d5e778) feat: organization slug optional - [`66484d7`](https://github.com/better-auth/better-auth/commit/66484d70e788a45dae5754bc4ddb3ece4082eeb5) feat: add tests - [`b24d5a6`](https://github.com/better-auth/better-auth/commit/b24d5a6ba574a6fc392b513cce152c0bc4f04cdd) docs: update docs to indicate slug is optional - [`7d511d9`](https://github.com/better-auth/better-auth/commit/7d511d934018cf59021bd4150dd51b99a3f440e8) fix: slug optional on prisma snapshot ### 📊 Changes **6 files changed** (+25 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/organization.mdx` (+2 -1) 📝 `packages/better-auth/src/plugins/organization/organization.test.ts` (+9 -9) 📝 `packages/better-auth/src/plugins/organization/organization.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/organization/routes/crud-org.ts` (+10 -8) 📝 `packages/better-auth/src/plugins/organization/schema.ts` (+2 -2) 📝 `packages/cli/test/__snapshots__/schema-mysql-custom.prisma` (+1 -1) </details> ### 📄 Description Enables organizations to be created without a `slug`. Continues to check `slug` when provided. Organizations may simply utilize the organization `id` if needed for URLs. Closes #6662 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Organizations can now be created without a slug. Slug uniqueness is only checked when provided, and docs/types/schema mark slug as optional. - **Migration** - Make slug optional/nullable in your database and API responses. - Use organization id for URLs when no slug is set. <sup>Written for commit 7d511d934018cf59021bd4150dd51b99a3f440e8. Summary will update 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-03-13 12:55: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#6347