Unable to log into customer account when using shopify theme serve

Topic summary

Core issue: Customer login fails when developing locally with “shopify theme serve” at http://127.0.0.1:9292, largely due to Google reCAPTCHA challenges that redirect to my-shop.myshopify.com/challenge, causing loops, 404s, or “Invalid or missing reCAPTCHA token” errors. CLI = Shopify Command Line Interface; reCAPTCHA = Google’s anti‑bot check.

Earlier update: Shopify released CLI 2.3.0, which fixed the initial non‑reCAPTCHA login issue; users confirmed success. However, with reCAPTCHA enabled, the problem persisted across versions 2.6.x, 2.7.4, 3.21.0, 3.44.1, 3.49.3, and 3.60.1.

Workarounds reported:

  • Disable Google reCAPTCHA (Online Store > Preferences > Spam protection). Note: one report says the toggle was removed in Customer Accounts settings, reducing this option in some stores.
  • Use the “Share this theme preview” URL from the CLI for testing (no hot reload; updates on refresh).
  • For live themes, submit a reCAPTCHA token via JS: window.grecaptcha.enterprise.execute(siteKey, { action }) and include it as recaptcha-v3-token.

Shopify staff acknowledged, asked for DEBUG=1 logs, and linked upgrade guidance; GitHub issues referenced (#1992, #1636). Status: unresolved for reCAPTCHA + localhost; discussion remains open.

Summarized with AI on December 24. AI used: gpt-5.

Update on this - here’s the solution - not sure what’s kosher here so keeping it brief! Site key is in the html for loading the recaptcha.

const token = await window.grecaptcha.enterprise.execute(RECAPTCHA_SITE_KEY, { action });
formParams['recaptcha-v3-token'] = token