-
Notifications
You must be signed in to change notification settings - Fork 27
feat(auth): add Cloudflare Turnstile bot protection and rate limiting #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
8e4c91c
163f389
cbb821e
38dcad0
025e827
2aab890
c2d139b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| name: Greetings | ||
| name: Greetings | ||
|
|
||
| on: | ||
| pull_request_target: | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -99,6 +99,7 @@ The setup script detects your environment automatically: | |||||||||||
| ```env | ||||||||||||
| VITE_API_URL= # leave blank for local dev; Vite proxy handles /api/* | ||||||||||||
| VITE_DEV_MODE=true # enables DEV LOGIN button; never set true in production | ||||||||||||
| VITE_TURNSTILE_SITE_KEY= # Cloudflare Turnstile site key | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| **Backend** — copy `backend/.env.example` to `backend/.env`: | ||||||||||||
|
|
@@ -109,9 +110,14 @@ SUPABASE_KEY=<auto-filled by npm run setup> | |||||||||||
| SUPABASE_SERVICE_KEY= | ||||||||||||
| FRONTEND_URL=http://localhost:5173 | ||||||||||||
| API_BASE_URL=http://localhost:8000 | ||||||||||||
| TURNSTILE_SECRET_KEY= | ||||||||||||
| DEV_BYPASS_AUTH=true # never set true in production | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| > Note: When using production auth flows, set `VITE_TURNSTILE_SITE_KEY` in the frontend and `TURNSTILE_SECRET_KEY` in the backend. This enables Cloudflare Turnstile protection for auth endpoint requests. | ||||||||||||
|
|
||||||||||||
| > Authentication start requests are rate limited in the backend to 5 requests per minute. Invalid or missing Turnstile tokens are rejected with a standard 400 response. | ||||||||||||
|
|
||||||||||||
|
Comment on lines
+117
to
+120
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix blockquote formatting to satisfy markdownlint. There is a blank line inside a blockquote block, which triggers MD028. Keep the blockquote contiguous. Suggested patch > Note: When using production auth flows, set `VITE_TURNSTILE_SITE_KEY` in the frontend and `TURNSTILE_SECRET_KEY` in the backend. This enables Cloudflare Turnstile protection for auth endpoint requests.
-
> Authentication start requests are rate limited in the backend to 5 requests per minute. Invalid or missing Turnstile tokens are rejected with a standard 400 response.📝 Committable suggestion
Suggested change
🧰 Tools🪛 markdownlint-cli2 (0.22.1)[warning] 118-118: Blank line inside blockquote (MD028, no-blanks-blockquote) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||||
| ### Available Scripts | ||||||||||||
|
|
||||||||||||
| | Script | Description | | ||||||||||||
|
|
||||||||||||
Uh oh!
There was an error while loading. Please reload this page.