WIP: feat(captcha): implement captcha validation hooks and integrate … #1129
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces extensible support for CAPTCHA validation in the user registration flow, allowing host applications to add custom security checks (such as Turnstile or reCAPTCHA) without modifying the core codebase. The changes include new hook methods in the controller, updates to the registration view for easy extension, and improved error messaging with localization.
Extensibility for CAPTCHA Validation
validate_captcha_if_enabledandhandle_captcha_validation_failurehook methods toBetterTogether::Users::RegistrationsController, allowing host apps to implement and customize CAPTCHA logic and error handling. Default implementations are provided and can be overridden.View and Form Extensibility
_extra_registration_fields.html.erbwith guidance for host apps to add custom registration fields (e.g., CAPTCHA), and rendered this partial in the registration form. [1] [2]Localization and Error Messaging
captcha_validation_failederror message to English, Spanish, and French locale files for improved user feedback on CAPTCHA failures. [1] [2] [3]Testing