Skip to content

Revert "Fix 401 Unauthorized on cart AJAX endpoints during shopify theme dev"#6975

Open
EvilGenius13 wants to merge 2 commits intomainfrom
revert-6839-kd-add-to-cart-bug
Open

Revert "Fix 401 Unauthorized on cart AJAX endpoints during shopify theme dev"#6975
EvilGenius13 wants to merge 2 commits intomainfrom
revert-6839-kd-add-to-cart-bug

Conversation

@EvilGenius13
Copy link
Contributor

Reverts #6839

@EvilGenius13 EvilGenius13 requested review from a team as code owners March 11, 2026 14:12
@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 2026

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 77.21% 14539/18830
🟡 Branches 70.86% 7206/10170
🟡 Functions 76.2% 3697/4852
🟡 Lines 78.71% 13747/17465

Test suite run success

3791 tests passing in 1462 suites.

Report generated by 🧪jest coverage report action from 5dd39d0

// Only include Authorization for theme dev, not theme-extensions
if (ctx.type === 'theme') {
baseHeaders.Authorization = `Bearer ${ctx.session.storefrontToken}`
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bearer token sent to cart/checkout/account endpoints again (regression to 401s)

proxyStorefrontRequest now always adds Authorization: Bearer ${ctx.session.storefrontToken} for ctx.type === 'theme', regardless of path. The reverted logic previously excluded cart/checkout/account because those endpoints rely on session-cookie auth; sending a Bearer token can cause SFR to select token auth that lacks cart scopes, reintroducing 401/auth failures during theme dev (e.g., /cart/add.js, /cart/update.js, /cart.js, /cart.json, /cart/change.js, /cart, /checkouts/..., /account/logout, other account routes).

@binks-code-reviewer
Copy link

🤖 Code Review · #projects-dev-ai for questions
React with 👍/👎 or reply — all feedback helps improve the agent.

Complete - 1 findings

📋 History

✅ 1 findings

@EvilGenius13 EvilGenius13 force-pushed the revert-6839-kd-add-to-cart-bug branch from 3577896 to 5dd39d0 Compare March 12, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants