fix(register): render Turnstile so website signups pass captcha
Merged
RI
2d ago+2+2+0123456789-2-2-0123456789
Summary (AI generated)
- Website signups fail since the move to
POST /auth/register(#1235) with a captcha error. register.astrois prerendered and readCLOUDFLARE_TURNSTILE_SITE_KEYviaimport.meta.env, which does not receive the CI secret at build time, so the Turnstile widget was never rendered and nocaptcha_tokenwas sent.- Now falls back to
process.env.CLOUDFLARE_TURNSTILE_SITE_KEYat build time.
Test plan (AI generated)
-
astro devwithCLOUDFLARE_TURNSTILE_SITE_KEYset: the fixed page renders.cf-turnstilewith the key; the unfixed page renders none (control). - After deploy, https://capgo.app/register/ shows the Turnstile widget and a signup succeeds.
Screenshots (AI generated)
No visual change beyond the Turnstile widget appearing under the password field.
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by CodeRabbit
- Bug Fixes
- Improved CAPTCHA configuration handling by falling back to an available environment setting when the primary site key is unavailable.
- CAPTCHA enablement and widget rendering continue to work with the resolved configuration.