When enabled, registration and login require a Cloudflare Turnstile token.
Flow
- The dashboard renders a Turnstile widget with action
turnstile-spin-v2using the site key fromGET /auth/config. - The client sends the token as
turnstileTokenin the register/login body. - The backend calls the canonical siteverify endpoint:
POST https://challenges.cloudflare.com/turnstile/v0/siteverify
with secret, response, and remoteip, and only proceeds when success === true and the action matches.
Config endpoint
curl https://use.studioapi.dev/auth/config
{
"data": {
"turnstile_site_key": "0x...",
"turnstile_required": true,
"google_oauth_enabled": true,
"github_oauth_enabled": true
}
}
Errors
| Code | Status | Meaning |
|---|---|---|
TURNSTILE_REQUIRED | 400 | Token missing when required. |
TURNSTILE_FAILED | 403 | Token invalid or action mismatch. |