Skip to content

Commit b4787a5

Browse files
test: update class docblock to reflect session-driven captcha approach
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4d08c41 commit b4787a5

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

tests/UserLoginTurnstileTest.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@
2323
* Class UserLoginTurnstileTest
2424
*
2525
* Covers Cloudflare Turnstile integration in UserController::postLogin():
26-
* - cf-turnstile-response required when login_attempts (from request body) >= threshold
26+
* - cf-turnstile-response required when captcha_failed_attempts (session) >= threshold
2727
* - threshold gating (before / at boundary / above boundary)
28-
* - omitted login_attempts field defaults to zero (no captcha required)
29-
* - captcha is gated on the request-body counter
28+
* - absent captcha_failed_attempts in session defaults to 0 (no captcha required)
29+
* - captcha gate is driven by the server-side session counter, not the request body
30+
* - request-body login_attempts is ignored (attacker cannot bypass by posting 0)
31+
* - enumeration safety: captcha fires for non-existent users too
3032
* - login screen emits Turnstile JS config after a failed attempt
3133
* - expired or unsolved token is rejected
34+
* - successful login clears the session counter
3235
*/
3336
final class UserLoginTurnstileTest extends BrowserKitTestCase
3437
{
@@ -285,4 +288,4 @@ public function testSuccessfulLoginClearsSessionCounter(): void
285288
'captcha_failed_attempts must be removed from session after a successful login'
286289
);
287290
}
288-
}
291+
}

0 commit comments

Comments
 (0)