Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace recaptcha alerts with generic errors #3627

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

chickenn00dle
Copy link
Contributor

@chickenn00dle chickenn00dle commented Dec 12, 2024

All Submissions:

Changes proposed in this Pull Request:

Closes https://app.asana.com/0/1207817176293825/1208950357031079/f

This PR replaces the default recaptcha failure alert behavior with generic errors appended to the relevant forms.

Checkout modal (passes custom error handler when rendering recaptcha):
Screenshot 2024-12-13 at 13 02 47

Registration modal (uses 'default' recaptcha error):
Screenshot 2024-12-13 at 13 05 41

Newsletters subscribe block (uses 'default' recaptcha error):
Screenshot 2024-12-13 at 13 06 29

Registration block (uses 'default' recaptcha error):
Screenshot 2024-12-13 at 13 07 47

How to test the changes in this Pull Request:

Checkout the following Newsletters PR before testing: Automattic/newspack-newsletters#1724

  • Setup recaptcha v2, RAS, and the various blocks necessary to test the above forms
  • Change the following line to: callback: () => errorCallback( 'There was an error with reCAPTCHA. Please try again.' ),. This will trigger an error even when recaptcha is successful for testing purposes.
  • Submit each of above forms as reader, and verify the recaptcha errors look fine.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@chickenn00dle chickenn00dle added the [Status] Needs Review The issue or pull request needs to be reviewed label Dec 13, 2024
@chickenn00dle chickenn00dle marked this pull request as ready for review December 13, 2024 18:11
@chickenn00dle chickenn00dle requested a review from a team as a code owner December 13, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ras-acc testing [Status] Needs Review The issue or pull request needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants