[PR #2156] [CLOSED] fix(disabledPaths): Disable paths on api calls #4182

Closed
opened 2026-03-13 11:36:06 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/2156
Author: @CrutchTheClutch
Created: 4/6/2025
Status: Closed

Base: mainHead: patch-3


📝 Commits (5)

  • ed23655 fix(disabledPaths): Disable paths on api calls
  • 937f581 Update to-auth-endpoints.ts
  • ad41d13 lint
  • 11779c6 use generic 404 response
  • 3612550 Merge branch 'better-auth:main' into patch-3

📊 Changes

1 file changed (+3 additions, -0 deletions)

View changed files

📝 packages/better-auth/src/api/to-auth-endpoints.ts (+3 -0)

📄 Description

This may need some more thought, but if a path is disabled, it is currently only disabled on HTTP requests. When using the auth.api. the routes still execute like normal. I feel like for consistency it would make sense to also return a 404 in these 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/2156 **Author:** [@CrutchTheClutch](https://github.com/CrutchTheClutch) **Created:** 4/6/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `patch-3` --- ### 📝 Commits (5) - [`ed23655`](https://github.com/better-auth/better-auth/commit/ed23655ae1937184fede7a13ca7580ecbd011049) fix(disabledPaths): Disable paths on api calls - [`937f581`](https://github.com/better-auth/better-auth/commit/937f5813c52f0e12a064fe88b0d75034481ee42a) Update to-auth-endpoints.ts - [`ad41d13`](https://github.com/better-auth/better-auth/commit/ad41d13e34eda9f50300f27c1397d19ee0811402) lint - [`11779c6`](https://github.com/better-auth/better-auth/commit/11779c6d90df989914bab2092ad57b39cd617a9f) use generic 404 response - [`3612550`](https://github.com/better-auth/better-auth/commit/3612550f20efd4a31a64573606886fe99ce2f0a7) Merge branch 'better-auth:main' into patch-3 ### 📊 Changes **1 file changed** (+3 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/to-auth-endpoints.ts` (+3 -0) </details> ### 📄 Description This may need some more thought, but if a path is disabled, it is currently only disabled on HTTP requests. When using the `auth.api.` the routes still execute like normal. I feel like for consistency it would make sense to also return a 404 in these cases --- <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 11:36:06 -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#4182