Shopify / Shopify/liquid

reCAPTCHA challenge jumps to the original form instead of the captcha form

Open
#1,649 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
11.9k
Forks
1.5k
Avg merge
17h 55m
Merged PRs (30d)
3

Description

Issue

If you submit a form and get the captcha challenge page, the page jumps to the original form.

Expected

On the challenge page, the page should jump to the reCAPTCHA form.

Step to reproduce

  1. Create a form, such as
{% form 'customer', id: 'ContactFooter' %}
  <div class="email">
    <label for="email">Email</label>
    <input type="email" name="contact[email]" />
  </div>
  <div class="submit">
    <input type="submit" value="Sign up" />
  </div>
{% endform %}
  1. Submit the form (you may have to submit a few times to get it to fallback to reCAPTCHA v2)
  2. Get to the challenge page, which will be https://[devSite].myshopify.com/challenge#ContactFooter

Ideally, the url should be https://[devSite].myshopify.com/challenge#[id to shopify captcha wrapper (most outer element)]

Fix

Option 1

Don't include the url hash at all. Just have the page land at the top.

Option 2

Shopify generates the content for the page in a wrapper class shopify-challenge__container, so have an id on this element and use that for the anchor in the url. It shouldn't jump directly to the recaptcha form because the user might miss the content in shopify-challenge__message, such as "To continue, let us know you're not a robot."

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the code that generates the challenge page and its URL hash, then inspect how the shopify-challenge__container and shopify-challenge__message elements are rendered. Reproduce the ContactFooter example and verify that the challenge URL either has no hash or targets the outer challenge container rather than the reCAPTCHA form.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.