-
Notifications
You must be signed in to change notification settings - Fork 683
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
Add ShopHost concern for fetching and saving host #1360
Conversation
bdddca4
to
256700e
Compare
256700e
to
f430d26
Compare
Hey @gonzaloriestra @NabeelAhsen! |
Hi @kirillplatonov I recently posted an issue for this gem. Do you think adding the
Are you proposing something like this?
I'm a little confused where to add the host param, does it need to be base64 encoded etc. Thanks for your help. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your contribution and sorry for the late review!
It looks good to me, although I'd like to confirm the approach with @mkevinosullivan @paulomarg or @hannachen as I think they've been working more closely with this.
@gonzaloriestra sounds good. Resolved conflicts in this PR so it's ready to merge. |
Overall this makes a lot of sense to me! I think making this a concern makes it a lot easier to add other controllers. Just a couple of thoughts that came to me:
Thank you for this! |
Inspired by this PR, I came up with another way to fetch host without cookies. And it works well with an app on hand. #1403 |
Right now, AppBridge JWTs have a payload with lots of info. Wouldn't it make more sense to include the host parameter in this payload too, then build a backend helper to access it everywhere? @hoppergee, what do you think? |
This pull request is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days. |
We are closing this pull request because it has been inactive for a few months. If you still encounter this pull request with the latest stable version, please reopen using the pull request template. You can also contribute directly by submitting a pull request– see the CONTRIBUTING.md file for guidelines Thank you! |
The problem
Right now in AppBridge 2.0 apps, it's not possible to open any app link in a new tab (it won't load without
host
param). The only workaround is to passhost
to every link in the app which is pretty hard to manage.What this PR does
This PR introduces
ShopifyApp::ShopHost
concern which handleshost
fetching and caches it in cookies. This allows avoiding passing host param manually to every link. I found this concern very convenient and use it in all of my apps.Checklist
Before submitting the PR, please consider if any of the following are needed:
CHANGELOG.md
if the changes would impact usersREADME.md
, if appropriate./docs
, if necessary