[PR #3867] [CLOSED] feat: schema check for user side input #5055

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3867
Author: @himself65
Created: 8/7/2025
Status: Closed

Base: canaryHead: himself65/2025/08/07/check


📝 Commits (2)

  • 38dfe82 feat: schema check for user side input
  • a1c2d2b fix: close db

📊 Changes

2 files changed (+136 additions, -8 deletions)

View changed files

packages/better-auth/src/db/get-schema.test.ts (+107 -0)
📝 packages/better-auth/src/db/get-schema.ts (+29 -8)

📄 Description

This is my idea for validating user-side input. We should have more of both type checking and runtime checking to make sure the logic is working correctly.


Summary by cubic

Added schema validation for user input in getSchema to catch invalid configurations at runtime.

  • Bug Fixes
  • Throws a clear error if the user or plugin schema is invalid.
  • Added tests to cover valid and invalid schema cases.

🔄 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/3867 **Author:** [@himself65](https://github.com/himself65) **Created:** 8/7/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `himself65/2025/08/07/check` --- ### 📝 Commits (2) - [`38dfe82`](https://github.com/better-auth/better-auth/commit/38dfe82b34c7ef114158c7ef26de9ca077c8d747) feat: schema check for user side input - [`a1c2d2b`](https://github.com/better-auth/better-auth/commit/a1c2d2b4a497566c7d2a468afae57724efe9bb83) fix: close db ### 📊 Changes **2 files changed** (+136 additions, -8 deletions) <details> <summary>View changed files</summary> ➕ `packages/better-auth/src/db/get-schema.test.ts` (+107 -0) 📝 `packages/better-auth/src/db/get-schema.ts` (+29 -8) </details> ### 📄 Description This is my idea for validating user-side input. We should have more of both type checking and runtime checking to make sure the logic is working correctly. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Added schema validation for user input in getSchema to catch invalid configurations at runtime. - **Bug Fixes** - Throws a clear error if the user or plugin schema is invalid. - Added tests to cover valid and invalid schema cases. <!-- 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:09:21 -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#5055