Skip to content

release: develop to main — Turnstile captchaToken fix for signup gate - #220

Merged
ayoub3bidi merged 2 commits into
mainfrom
develop
Aug 4, 2026
Merged

release: develop to main — Turnstile captchaToken fix for signup gate#220
ayoub3bidi merged 2 commits into
mainfrom
develop

Conversation

@ayoub3bidi

Copy link
Copy Markdown
Owner

Contribution workflow

  • Base branch is main: This PR targets main for production release.
  • Guidelines and docs: I have read CONTRIBUTING.md and the docs relevant to my change.
  • This template: I kept the PR template structure and filled in the sections below.

Description

Release develop to production. This batch contains the follow-up fix for the Cloudflare Turnstile signup gate: the Turnstile token must be passed via options.captchaToken (GoTrue gotrue_meta_security.captcha_token), not a data payload that auth-js ignores.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • 📚 Documentation update
  • 🧪 Test addition or improvement

Related Issues

Merges PR #219 from develop.

Changes Made

  • signInWithGoogleIdToken: send the Turnstile token as options: { captchaToken } — verified against auth-js 2.108.2 SignInWithIdTokenCredentials.
  • before-signup: remove the impossible raw_user_meta_data.cf_turnstile_response check; GoTrue verifies CAPTCHA when Auth → CAPTCHA protection is enabled. IP bans + signup rate limits remain.
  • .env.example: point the Turnstile secret at Supabase Auth CAPTCHA settings (not an edge-function-only path).
  • authService unit tests updated to the captchaToken shape.

Testing

  • All existing tests pass
  • New tests added for new functionality

Code Quality

  • ESLint passes (pnpm lint)
  • Prettier formatting applied (pnpm format:check)
  • Build succeeds (pnpm build)

Breaking Changes

  • None. TURNSTILE_SECRET_KEY on the edge function is unused after this change; Auth CAPTCHA (dashboard) is the correct place for the Turnstile secret.

Additional Notes

Ops after this release reaches production: enable Supabase Dashboard → Authentication → Bot and Abuse Protection → CAPTCHA (Cloudflare Turnstile) and paste the Turnstile secret key so GoTrue verifies captchaToken. Then test with a new Google account (existing accounts never hit Before User Created).

…tadata check

signInWithIdToken does not accept a top-level data/raw_user_meta_data
payload; auth-js ignores it. Send the token as options.captchaToken
(gotrue_meta_security.captcha_token) so GoTrue can verify it when Auth
CAPTCHA protection is enabled. Remove the impossible
raw_user_meta_data.cf_turnstile_response check from before-signup; IP
bans and signup rate limits remain.
fix: pass Turnstile via captchaToken and stop broken before-signup metadata check
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ae70c8c7-6bdf-480c-a0c3-4adba8666155

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the tests label Aug 4, 2026
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ayoub3bidi
ayoub3bidi merged commit 5ce0df9 into main Aug 4, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant