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 Theme Access authentication on shopify theme dev and shopify theme console commands #4490

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

karreiro
Copy link
Contributor

@karreiro karreiro commented Sep 20, 2024

WHY are these changes introduced?

Fixes #4477

The shopify theme console command was failing since this change, because the Theme Access requests need the Authorization header.

WHAT is this pull request doing?

This PR now just passes the Authorization header as we already have it at the moment the session is initialized.

This PR also avoids propagating the content-type of the SFR response, because when it's being proxied by the Theme Access app, that content-type is set to application/json (we're not introducing any branching code here, to protect the CLI from future changes, and in the end, the content-type should never be application/json).

How to test your changes?

Use the following command passing the Theme Access token:

  • Install the Theme Access app in your store
  • Generate a Theme Access app password
  • Run shopify theme dev --password <your_theme_access_password> --store <your_store>
  • Run shopify theme console --password <your_theme_access_password> --store <your_store>

Before:
Screenshot 2024-09-20 at 08 11 33

After:
Screenshot 2024-09-20 at 08 11 04

Post-release steps

N/a

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Contributor

Thanks for your contribution!

Depending on what you are working on, you may want to request a review from a Shopify team:

  • Themes: @shopify/advanced-edits
  • UI extensions: @shopify/ui-extensions-cli
    • Checkout UI extensions: @shopify/checkout-ui-extensions-api-stewardship
  • Hydrogen: @shopify/hydrogen
  • Other: @shopify/app-inner-loop

Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
73.02% (+0.02% 🔼)
8390/11490
🟡 Branches
69.57% (+0.03% 🔼)
4092/5882
🟡 Functions 71.75% 2179/3037
🟡 Lines
73.37% (+0.02% 🔼)
7939/10821

Test suite run success

1889 tests passing in 857 suites.

Report generated by 🧪jest coverage report action from cce54b1

Copy link
Contributor

@frandiox frandiox left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix, it works well 🎉

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.

[Bug]: Could not use theme dev since CLI 3.67
2 participants