[PR #4967] [CLOSED] fix: add required constraint to slug filed in org plugin #31287

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4967
Author: @bytaesu
Created: 9/29/2025
Status: Closed

Base: canaryHead: fix/organization-schema


📝 Commits (10+)

📊 Changes

74 files changed (+5736 additions, -1257 deletions)

View changed files

demo/expo-example/.env.example (+7 -0)
demo/expo-example/.gitignore (+20 -0)
demo/expo-example/README.md (+15 -0)
demo/expo-example/app.config.ts (+55 -0)
demo/expo-example/assets/bg-image.jpeg (+0 -0)
demo/expo-example/assets/fonts/SpaceMono-Regular.ttf (+0 -0)
demo/expo-example/assets/icon.png (+0 -0)
demo/expo-example/assets/images/adaptive-icon.png (+0 -0)
demo/expo-example/assets/images/favicon.png (+0 -0)
demo/expo-example/assets/images/logo.png (+0 -0)
demo/expo-example/assets/images/partial-react-logo.png (+0 -0)
demo/expo-example/assets/images/react-logo.png (+0 -0)
demo/expo-example/assets/images/react-logo@2x.png (+0 -0)
demo/expo-example/assets/images/react-logo@3x.png (+0 -0)
demo/expo-example/assets/images/splash.png (+0 -0)
demo/expo-example/babel.config.js (+9 -0)
demo/expo-example/components.json (+6 -0)
demo/expo-example/index.ts (+1 -0)
demo/expo-example/metro.config.js (+39 -0)
demo/expo-example/nativewind-env.d.ts (+3 -0)

...and 54 more files

📄 Description

This PR adds a required constraint to the slug field in the Organization plugin schema.
It resolves the following logical inconsistencies:

  • slug is required in the request body when creating an Organization.
  • The schema section in the docs already indicates it as required.

+) The same issue exists for clientId, accessToken, and refreshToken in the OIDC Provider plugin. However, I haven’t touched them since I haven’t used this plugin and it’s currently marked as under development.


Summary by cubic

Make the slug field required in the Organization plugin schema. This aligns validation with the create-organization request and docs, preventing organizations from being created without a slug.


🔄 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/4967 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 9/29/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `fix/organization-schema` --- ### 📝 Commits (10+) - [`825f8e1`](https://github.com/better-auth/better-auth/commit/825f8e1d7ca9eba91e8b80acce491684c9437692) init - [`b2ddc0c`](https://github.com/better-auth/better-auth/commit/b2ddc0c1b484ecf555d7f7a30c9d3e72313eb962) blog - [`22cd9f0`](https://github.com/better-auth/better-auth/commit/22cd9f0c95626a0c525753e4e51d2d53e115464e) chore: dotenv - [`42af8f8`](https://github.com/better-auth/better-auth/commit/42af8f81d13d1ea808928b1d714a1606d5666fe9) update - [`7af508e`](https://github.com/better-auth/better-auth/commit/7af508ee908f764ee9458f6bc9eeb6ab4c825d6d) some update - [`1be889b`](https://github.com/better-auth/better-auth/commit/1be889bb831c879474bdc51cdf96264a13b666a5) docs: add mentions - [`8bc6b18`](https://github.com/better-auth/better-auth/commit/8bc6b18c702b70c9919d27840420e50bd6c61d5e) updates - [`8aeb9b0`](https://github.com/better-auth/better-auth/commit/8aeb9b018835ff93cec8ed6eb837a0a3523ea2aa) chore: use tsconfig monorepo setup (#4826) - [`a3baacb`](https://github.com/better-auth/better-auth/commit/a3baacb148ee8120a19641f6442f993037354f20) docs: change banner - [`d007bda`](https://github.com/better-auth/better-auth/commit/d007bdac99ad626ec8233b32eeedd5bb3de036cb) docs: add link to auth.js team announcement ### 📊 Changes **74 files changed** (+5736 additions, -1257 deletions) <details> <summary>View changed files</summary> ➕ `demo/expo-example/.env.example` (+7 -0) ➕ `demo/expo-example/.gitignore` (+20 -0) ➕ `demo/expo-example/README.md` (+15 -0) ➕ `demo/expo-example/app.config.ts` (+55 -0) ➕ `demo/expo-example/assets/bg-image.jpeg` (+0 -0) ➕ `demo/expo-example/assets/fonts/SpaceMono-Regular.ttf` (+0 -0) ➕ `demo/expo-example/assets/icon.png` (+0 -0) ➕ `demo/expo-example/assets/images/adaptive-icon.png` (+0 -0) ➕ `demo/expo-example/assets/images/favicon.png` (+0 -0) ➕ `demo/expo-example/assets/images/logo.png` (+0 -0) ➕ `demo/expo-example/assets/images/partial-react-logo.png` (+0 -0) ➕ `demo/expo-example/assets/images/react-logo.png` (+0 -0) ➕ `demo/expo-example/assets/images/react-logo@2x.png` (+0 -0) ➕ `demo/expo-example/assets/images/react-logo@3x.png` (+0 -0) ➕ `demo/expo-example/assets/images/splash.png` (+0 -0) ➕ `demo/expo-example/babel.config.js` (+9 -0) ➕ `demo/expo-example/components.json` (+6 -0) ➕ `demo/expo-example/index.ts` (+1 -0) ➕ `demo/expo-example/metro.config.js` (+39 -0) ➕ `demo/expo-example/nativewind-env.d.ts` (+3 -0) _...and 54 more files_ </details> ### 📄 Description This PR adds a required constraint to the `slug` field in the Organization plugin schema. It resolves the following logical inconsistencies: - slug is required in the request body when creating an Organization. - The schema section in the [docs](https://www.better-auth.com/docs/plugins/organization#organization-1) already indicates it as required. +) The same issue exists for `clientId`, `accessToken`, and `refreshToken` in the OIDC Provider plugin. However, I haven’t touched them since I haven’t used this plugin and it’s currently marked as under development. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Make the slug field required in the Organization plugin schema. This aligns validation with the create-organization request and docs, preventing organizations from being created without a slug. <!-- 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 22:10:29 -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#31287