Repository navigation
feat(auth): Cloudflare Turnstile on the sign-in page - #172
Merged
Merged
Conversation
0.6.0 adds the optional Turnstile check to oauth-server-kit's hosted sign-in form. SendLit only imports mcp-server-kit in its parity test, so 0.5.0's move to MCP SDK 2 needs no product change here.
With TURNSTILE_SITE_KEY and TURNSTILE_SECRET_KEY set, the hosted login (/login and /oauth/login) renders the Turnstile widget and Better Auth's captcha plugin verifies its token on /email-otp/send-verification-otp, so a script can no longer make SendLit email sign-in codes to arbitrary addresses. With either key unset, sign-in is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The hosted sign-in page (
/login, which the dashboard redirects to, and/oauth/loginfor MCP/OAuth clients) can show a Cloudflare Turnstile check before it emails a sign-in code. Better Auth'scaptchaplugin verifies the token on/email-otp/send-verification-otp.TURNSTILE_SITE_KEYandTURNSTILE_SECRET_KEYare set. With either unset, sign-in is unchanged. Both are documented inapps/api/.env.example.@codelitdev/oauth-server-kit(feat(oauth-server-kit): optional Cloudflare Turnstile on the hosted sign-in form platform#20). This PR bumps every@codelitdev/*package to 0.6.0 and syncs the managed files with platform-cli 0.6.0.Why
Without a bot check, anyone can script the sign-in page to make SendLit email codes to arbitrary addresses.
Deploying
Testing
MISSING_RESPONSEplatform-cli doctoris clean.Turnstile always challenges automated or embedded browsers with real keys, so automated end-to-end tests need Cloudflare's test keys.