[GH-ISSUE #956] Support Cloudflare Turnstile #8519

Closed
opened 2026-04-13 03:36:44 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @0scrm on GitHub (Dec 19, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/956

Is this suited for github?

  • Yes, this is suited for github

It is often a good idea to put some endpoints behind a CAPTCHA challenge. The sign-up, sign-in and forgot password endpoints exposed by better-auth could benefit from such security.

Describe the solution you'd like

This would be a perfect candidate for a plugin. Using the middleware to get a captcha response token, we could then submit it to Cloudflare and only let the request through if the challenge is passed.
The plugin would allow for custom "protected endpoints" array, so fit all use-cases.

Describe alternatives you've considered

Without creating a custom plugin, I cannot think of a way to protect the better-auth default endpoints behind a CAPTCHA challenge. Unless we don't use the better-auth client and build custom endpoints.

Additional context

I have built such a plugin already for my personal project. I will happily submit a PR!
I would be also happy to build a similar plugin for Google ReCAPTCHA

Originally created by @0scrm on GitHub (Dec 19, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/956 ### Is this suited for github? - [X] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. It is often a good idea to put some endpoints behind a CAPTCHA challenge. The sign-up, sign-in and forgot password endpoints exposed by better-auth could benefit from such security. ### Describe the solution you'd like This would be a perfect candidate for a plugin. Using the middleware to get a captcha response token, we could then submit it to Cloudflare and only let the request through if the challenge is passed. The plugin would allow for custom "protected endpoints" array, so fit all use-cases. ### Describe alternatives you've considered Without creating a custom plugin, I cannot think of a way to protect the better-auth default endpoints behind a CAPTCHA challenge. Unless we don't use the better-auth client and build custom endpoints. ### Additional context I have built such a plugin already for my personal project. I will happily submit a PR! I would be also happy to build a similar plugin for Google ReCAPTCHA
GiteaMirror added the locked label 2026-04-13 03:36:44 -05:00
Author
Owner

@JoshZA commented on GitHub (Dec 20, 2024):

👍 This would be super useful

<!-- gh-comment-id:2557160384 --> @JoshZA commented on GitHub (Dec 20, 2024): 👍 This would be super useful
Author
Owner

@harisvsulaiman commented on GitHub (Mar 3, 2025):

@Bekacru Shouldnt this be closed?

<!-- gh-comment-id:2693557139 --> @harisvsulaiman commented on GitHub (Mar 3, 2025): @Bekacru Shouldnt this be closed?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8519