Skip captcha for visitors with a valid idb_* cookie#125
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #124
If the browser holds any idb_* cookie (Yandex identity tokens that indicate a returning visitor), the SmartCaptcha widget is neither shown nor required in the CTA form, and the backend skips captcha verification as well. Fixes #124
Working session summaryDone. Here's what was implemented: Frontend (
Backend (
Tests (
All 7 tests pass. PR: #125 This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $0.827789📊 Context and tokens usage:Claude Sonnet 4.6:
Total: (42 new + 32.8K cache writes + 1.3M cache reads) input tokens, 8.9K output tokens, $0.650244 cost Claude Haiku 4.5:
Total: (894 new + 67.6K cache writes + 642.6K cache reads) input tokens, 5.6K output tokens, $0.177545 cost 🤖 Models used:
📎 Log file uploaded as Gist (1818KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
This reverts commit b66b1f3.
Summary
hasIdbCookie()helper inHome.tsxthat checksdocument.cookiefor anyidb_*prefix.idb_*cookie is present, the SmartCaptcha widget is neither shown nor loaded, and the captcha token is not required on form submit.telegram-notify.php, captcha verification is skipped when anyidb_*cookie is present in$_COOKIE.tests/cta-captcha.test.mjswith a new test that validates the bypass behaviour and updated the existing test to match the new effect guard condition.How to reproduce the original issue
With
VITE_SMARTCAPTCHA_CLIENT_KEYset, the captcha widget always appeared for every visitor once they started typing their contact details — even returning users who already had Yandex identity (idb_*) cookies.Test plan
npm test— all 7 tests passidb_test=1cookie in the browser, open the CTA form, start typing in the contact field → captcha widget should not appearidb_*cookie → captcha widget should appear as beforeFixes #124