Skip login captcha when any idb_* cookie exists, not just idb_$z#133
Skip login captcha when any idb_* cookie exists, not just idb_$z#133
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #132
Fixes #132: a user may hold tokens for databases other than the current one. Using preg_grep on array_keys($_COOKIE) detects any idb_* cookie the same way the client-side hasIdbCookie() helper already does.
Working session summaryDone. Here's what was fixed and why: Root cause: PR #131 introduced captcha skipping in Fix: PR: #133 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.568802📊 Context and tokens usage:
Total: (25 new + 47.1K cache writes + 1.1M cache reads) input tokens, 5.0K output tokens, $0.568802 cost 🤖 Models used:
📎 Log file uploaded as Gist (1342KB)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 f6ae39a.
Summary
index.phplogin guard now skipsverifyCaptcha()when the user holds anyidb_*cookie, not justidb_$z(the current-database token).tests/index-captcha-skip.test.mjsto verify this behavior.Problem
PR #131 fixed captcha skipping only for users who already have a token for the current database (
idb_$z). But a user may be authenticated to a different database and carry anidb_<other>cookie. In that case the server still demanded a captcha even though the client already hid the widget — making the form unsubmittable.How to reproduce the issue
idb_Acookie.idb_*cookie is found).idb_$zi.e.idb_B).What changed
index.phplogin guard (line 8001):This mirrors the client-side
hasIdbCookie()check already insrc/pages/Home.tsx.Test plan
npm test— all 9 tests passindex.php skips SmartCaptcha verification for users with any idb_* cookie on loginpassesFixes #132