Skip to content

Comments

feat(captcha): add provider-based captcha support (Google v3 + Cloudflare Turnstile)#2364

Open
NullSablex wants to merge 1 commit intoLiveHelperChat:masterfrom
NullSablex:add-cloudflare-turnstile
Open

feat(captcha): add provider-based captcha support (Google v3 + Cloudflare Turnstile)#2364
NullSablex wants to merge 1 commit intoLiveHelperChat:masterfrom
NullSablex:add-cloudflare-turnstile

Conversation

@NullSablex
Copy link

  • Add centralized captcha settings/validation methods in erLhcoreClassUserValidator:
    getCaptchaSettings, validateAuthCaptcha, verifyGoogleRecaptchaV3,
    verifyCloudflareTurnstile, and postCaptchaVerifyRequest.
  • Replace inline captcha verification in modules/lhuser/login.php and
    modules/lhuser/forgotpassword.php with shared validation.
  • Update auth captcha error handling to use the generic string
    Captcha validation failed.
  • Extend system/recaptcha admin handling with provider support (google/turnstile),
    new Turnstile fields, and CSRF redirect fix to system/recaptcha.
  • Update captcha admin template with provider selector and provider-specific sections;
    use shared key labels (Site key / Secret key) in both provider blocks.
  • Update shared captcha rendering template to support:
    Google v3 token flow and Cloudflare Turnstile widget flow.
  • Set explicit captcha actions in auth templates:
    login_action and forgot_password_action.
  • Update install defaults (modules/lhinstall/install.php, cli/lib/install.php)
    to include provider and Turnstile keys in recaptcha_data.
  • Update translation catalogs (doc/translation_default/translation_web.ts,
    translations/*/translation.ts, including translations/en_EN/translation.ts)
    with the new captcha-related keys used by these changes.

…lare Turnstile)

- Add centralized captcha settings/validation methods in `erLhcoreClassUserValidator`:
  `getCaptchaSettings`, `validateAuthCaptcha`, `verifyGoogleRecaptchaV3`,
  `verifyCloudflareTurnstile`, and `postCaptchaVerifyRequest`.
- Replace inline captcha verification in `modules/lhuser/login.php` and
  `modules/lhuser/forgotpassword.php` with shared validation.
- Update auth captcha error handling to use the generic string
  `Captcha validation failed`.
- Extend `system/recaptcha` admin handling with provider support (`google`/`turnstile`),
  new Turnstile fields, and CSRF redirect fix to `system/recaptcha`.
- Update captcha admin template with provider selector and provider-specific sections;
  use shared key labels (`Site key` / `Secret key`) in both provider blocks.
- Update shared captcha rendering template to support:
  Google v3 token flow and Cloudflare Turnstile widget flow.
- Set explicit captcha actions in auth templates:
  `login_action` and `forgot_password_action`.
- Update install defaults (`modules/lhinstall/install.php`, `cli/lib/install.php`)
  to include provider and Turnstile keys in `recaptcha_data`.
- Update translation catalogs (`doc/translation_default/translation_web.ts`,
  `translations/*/translation.ts`, including `translations/en_EN/translation.ts`)
  with the new captcha-related keys used by these changes.
@NullSablex
Copy link
Author

Peço desculpas caso haja erros; esta é a minha primeira contribuição pública em algum projeto.

I apologize in case there are any mistakes; this is my first public contribution to a project.

@remdex
Copy link
Contributor

remdex commented Feb 11, 2026

Hi,

Thanks for effort, I'll try to review during this/next week :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants