[GH-ISSUE #4843] disabledPaths doesn't work for paths with variable components #18720

Closed
opened 2026-04-15 17:20:46 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @mifopen on GitHub (Sep 23, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/4843

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

e.g. disablePaths: ["/reset-password/{token}"]

Current vs. Expected behavior

Expected: "/reset-password/{token}" is not visible in api/auth/reference page
Actual: "/reset-password/{token}" is visible in api/auth/reference page
!: I haven't checked if it's actually disabled or not.

What version of Better Auth are you using?

1.3.14

System info

-

Which area(s) are affected? (Select all that apply)

Backend

Auth config (if applicable)


Additional context

No response

Originally created by @mifopen on GitHub (Sep 23, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/4843 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce e.g. `disablePaths: ["/reset-password/{token}"]` ### Current vs. Expected behavior Expected: "/reset-password/{token}" is not visible in `api/auth/reference` page Actual: "/reset-password/{token}" is visible in `api/auth/reference` page !: I haven't checked if it's actually disabled or not. ### What version of Better Auth are you using? 1.3.14 ### System info ```bash - ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript ``` ### Additional context _No response_
GiteaMirror added the lockedbug labels 2026-04-15 17:20:46 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Sep 23, 2025):

The disabledPaths feature in Better Auth v1.3.14 only supports exact string matching and does not handle variable path components like '/reset-password/{token}'. This means paths with dynamic segments will not be disabled unless you list every possible variant explicitly. There is an open pull request proposing support for glob patterns and wildcards in disabledPaths, which would allow flexible matching for variable paths, but this is not available in your current version yet see PR #3937. For now, you may need to use middleware or custom logic to handle these cases.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

<!-- gh-comment-id:3323923446 --> @dosubot[bot] commented on GitHub (Sep 23, 2025): <!-- Answer --> The disabledPaths feature in Better Auth v1.3.14 only supports exact string matching and does not handle variable path components like '/reset-password/{token}'. This means paths with dynamic segments will not be disabled unless you list every possible variant explicitly. There is an open pull request proposing support for glob patterns and wildcards in disabledPaths, which would allow flexible matching for variable paths, but this is not available in your current version yet [see PR #3937](https://github.com/better-auth/better-auth/pull/3937). For now, you may need to use middleware or custom logic to handle these cases. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/e862a245-c105-4b24-8f36-ebeb66060799?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/e862a245-c105-4b24-8f36-ebeb66060799?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/e862a245-c105-4b24-8f36-ebeb66060799?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/e862a245-c105-4b24-8f36-ebeb66060799?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e862a245-c105-4b24-8f36-ebeb66060799?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/e862a245-c105-4b24-8f36-ebeb66060799?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e862a245-c105-4b24-8f36-ebeb66060799?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/4843)
Author
Owner

@Kinfe123 commented on GitHub (Sep 25, 2025):

I guess it could be handled by glob pattern that i have a pr already #3937. will land soon

<!-- gh-comment-id:3331459868 --> @Kinfe123 commented on GitHub (Sep 25, 2025): I guess it could be handled by glob pattern that i have a pr already #3937. will land soon
Author
Owner

@dosubot[bot] commented on GitHub (Dec 25, 2025):

Hi, @mifopen. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that the disabledPaths feature in Better Auth v1.3.14 does not support variable path components like "/reset-password/{token}".
  • The current version only supports exact string matching, limiting flexibility.
  • A workaround using middleware was suggested.
  • A pull request (#3937) adding glob pattern support for more flexible path matching is in progress and expected to resolve this issue.

Next Steps:

  • Please confirm if this issue is still relevant with the latest version of better-auth after the PR merge.
  • If it is, feel free to comment to keep the discussion open; otherwise, I will automatically close this issue in 7 days.

Thanks for your understanding and contribution!

<!-- gh-comment-id:3691572670 --> @dosubot[bot] commented on GitHub (Dec 25, 2025): Hi, @mifopen. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that the `disabledPaths` feature in Better Auth v1.3.14 does not support variable path components like "/reset-password/{token}". - The current version only supports exact string matching, limiting flexibility. - A workaround using middleware was suggested. - A pull request (#3937) adding glob pattern support for more flexible path matching is in progress and expected to resolve this issue. **Next Steps:** - Please confirm if this issue is still relevant with the latest version of better-auth after the PR merge. - If it is, feel free to comment to keep the discussion open; otherwise, I will automatically close this issue in 7 days. Thanks for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#18720