fix(register): render Turnstile so website signups pass captcha

Merged
RI
2d ago
+2-2

Summary (AI generated)

  • Website signups fail since the move to POST /auth/register (#1235) with a captcha error.
  • register.astro is prerendered and read CLOUDFLARE_TURNSTILE_SITE_KEY via import.meta.env, which does not receive the CI secret at build time, so the Turnstile widget was never rendered and no captcha_token was sent.
  • Now falls back to process.env.CLOUDFLARE_TURNSTILE_SITE_KEY at build time.

Test plan (AI generated)

  • astro dev with CLOUDFLARE_TURNSTILE_SITE_KEY set: the fixed page renders .cf-turnstile with 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


View with [code]smith Autofix with [code]smith
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.