You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pixelfed/tests/Feature/Captcha
Ashley 4bd7e385ae Skip captcha enforcement when active driver is unconfigured
activeOn() only checked the global toggle and per-surface flag, so captcha
was enforced even when the active driver had no credentials (e.g. Turnstile
with an empty sitekey/secret). That rendered a widget that can never succeed
and locked every user out of the auth surfaces with a generic "The captcha
must be filled" 422. Gate activeOn() on the resolved driver's isConfigured()
so an unconfigured driver fails safe (captcha not enforced or rendered).

Verified red->green against the regression test:

  cd .worktrees/fix-captcha-unconfigured && DB_CONNECTION=sqlite \
    DB_DATABASE=:memory: APP_ENV=testing CACHE_STORE=array \
    SESSION_DRIVER=array QUEUE_CONNECTION=sync REDIS_CLIENT=predis \
    vendor/bin/pest tests/Feature/Captcha/CaptchaUnconfiguredLockoutTest.php --compact

  Without the isConfigured() gate: 2 failed, 2 passed (the unconfigured
  cases fail with the captcha 422; the configured controls pass).
  With the gate: 4 passed (8 assertions).
1 week ago
..
CaptchaUnconfiguredLockoutTest.php Skip captcha enforcement when active driver is unconfigured 1 week ago