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

Fetch host from query or HTTP header "shopify-app-bridge-host" for AppBridge V2 #1403

Closed

Conversation

hoppergee
Copy link

@hoppergee hoppergee commented Apr 10, 2022

What this PR does

Currently, AppBridge 2.0 needs a host parameter to initialize and work. But after migrating to session token, we can't easily get the host in each query. So, as inspired from #1360, we can use HTTP header to manual pass the host back to server instead of manually putting them in URL or cache in cookies.

Reviewer's guide to testing

Go check the additional concern ShopifyApp::SetShopHost which fetching host from params[:host] or the HTTP header shopify-app-bridge-host. This will help a Rails app to keep holding the host on hand through setting host in HTTP header by turbolinks or turbo and sending it back in view.

Checklist

Before submitting the PR, please consider if any of the following are needed:

  • Update CHANGELOG.md if the changes would impact users
  • Update README.md, if appropriate.
  • Update any relevant pages in /docs, if necessary
  • For security fixes, the Disclosure Policy must be followed.

@ghost ghost added the cla-needed label Apr 10, 2022
@hoppergee hoppergee force-pushed the set_shop_host_from_http_header branch from a614ec9 to 637ecc8 Compare April 10, 2022 03:26
@nelsonwittwer
Copy link
Contributor

Sorry this took so long to get to! Since this PR was opened we have a new version of app bridge to better support JWT sessions and that is the pattern we will be supporting for the long term.

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.

None yet

2 participants