Skip SmartCaptcha on start.html for visitors with an idb_* cookie#127
Skip SmartCaptcha on start.html for visitors with an idb_* cookie#127
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #126
Registered users who reach start.html already have Yandex identity tokens (idb_* cookies) and should not be prompted for captcha. An inline script now runs before the form renders: if any idb_* cookie is present, the SmartCaptcha widget elements are hidden and a placeholder token value is injected so the login form can submit without a real captcha challenge. Adds tests/start-captcha-skip.test.mjs to verify the bypass logic. Fixes #126
Working session summaryThe fix is complete. Here's a summary of what was done: Root cause: Issue #124 asked to skip SmartCaptcha on Fix: Added an inline
Tests: Added PR: #127 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.505808📊 Context and tokens usage:
Total: (28 new + 34.3K cache writes + 864.0K cache reads) input tokens, 7.9K output tokens, $0.505808 cost 🤖 Models used:
📎 Log file uploaded as Gist (755KB)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 3362571.
Summary
start.htmlthat detects anyidb_*cookie (Yandex identity tokens present for registered users)..smartcaptcha-wrapper,[data-smartcaptcha]) are hidden and a placeholder token is injected intoinput[name="smart-token"]so the login form can submit without a captcha challenge.data-skip-captcha="1"attribute is set on<html>so that any additional page-level logic (e.g. in index.php) can also detect and skip server-side captcha verification.tests/start-captcha-skip.test.mjsto verify the bypass behaviour.How to reproduce the original issue
With SmartCaptcha configured in the server-side login page, every visitor to
start.html(including already-registered users with valid Yandex tokens) was shown the captcha challenge — even though those users haveidb_*cookies that prove they are known to the system.PR #125 correctly fixed this on the main landing-page CTA form (
Home.tsx/telegram-notify.php), but missedstart.html, which is the actual login page used by registered users.Test plan
npm test— all 9 tests passidb_test=1cookie in the browser, openstart.html→ captcha widget should be hidden and the form should submit without a tokenidb_*cookie → captcha widget behaves normallyFixes #126