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

Feedback form reCAPTCHA fails intermittently #3873

Closed
taylor-steve opened this issue Feb 5, 2024 · 3 comments
Closed

Feedback form reCAPTCHA fails intermittently #3873

taylor-steve opened this issue Feb 5, 2024 · 3 comments
Assignees
Labels

Comments

@taylor-steve
Copy link
Contributor

Sometimes, for unauthenticated users, the Feedback form Captcha will show the green success checkmark but the form will fail to submit with the error "You must pass the reCAPTCHA challenge".

Screenshot 2024-02-05 at 2 59 27 PM

At first glance this seems similar to #3808 in the sense that sometimes the noscript tags are processed by the browser and sometimes they are not, causing the 'g-recaptcha-response' to be empty for the form. The reason for this was clear in #3808, less so here as it is very intermittent and can vary from reload to reload on the same page.

I can recreate fairly reliably by:

  • Viewing, not submitting, the feedback form at the SearchWorks homepage
  • Selecting the "Online" Access facet and viewing the feedback form on that page. This will tend not to work.

Inspecting the recaptcha source, when you see this, the form will work:
Screenshot 2024-02-05 at 2 27 08 PM

When seeing this, the form will fail:
Screenshot 2024-02-05 at 2 28 41 PM

Turning off noscript like in #3808 appears to work, but I'm less clear on why we would need to do this here.

@taylor-steve taylor-steve self-assigned this Feb 5, 2024
@taylor-steve
Copy link
Contributor Author

Seems to have started with v3.21.14.

Maybe the switch to turbo?
ambethia/recaptcha#407

@taylor-steve
Copy link
Contributor Author

Noting that this behavior occurs with any noscript tags in that form. It does not seem to be specific to reCAPTCHA or the recaptcha gem.

@taylor-steve
Copy link
Contributor Author

For reference, this noscript behavior happens anywhere in SeachWorks, but does not seem to impact behavior except in cases like reCAPTCHA where it is storing an empty g-recaptcha-response in the noscript elements.

Niqui found a link that seems to suggest it might be turbo related:

https://discuss.hotwired.dev/t/turbo-processes-noscript-children-when-merging-head/2552

It appears this wouldn't be an issue if we wanted to add our own noscript elements to those forms in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant