-
Notifications
You must be signed in to change notification settings - Fork 699
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
Support App Bridge 2.0 in shopify_app #1241
Conversation
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.
Looks good to me 👍
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.
Haven't 🎩 ed it, but the code looks good.
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.
I've tried this out now, and I got the following error:
message: "APP::ERROR::INVALID_CONFIG: host must be provided"
name: "AppBridgeError"
type: "APP::ERROR::INVALID_CONFIG"
It seems that coming back from OAuth, we're lacking the host
parameter and thus we can't load App Bridge properly.
Noticing that on my end too. It has to do with the |
If the Is this where the |
It's not part of the callback controller. The failure happens when hitting the home controller at the top level right after the callback controller though. |
Should we be including the host in the redirect URL when we begin OAuth? That way, we'd be able to reference it when coming back. |
fd775a1
to
a708424
Compare
return_address_with_params(shop: current_shopify_domain, host: host) | ||
rescue ShopifyDomainNotFound, ShopifyHostNotFound |
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.
This is needed because of the following:
shopify_app/app/controllers/shopify_app/callback_controller.rb
Lines 24 to 30 in 2fcf794
def respond_successfully | |
if jwt_request? | |
head(:ok) | |
else | |
redirect_to(return_address) | |
end | |
end |
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.
Things I'm unsure about here:
- Right now, there are two known places that use
return_address
in this code base. Is raising whenhost
isn't found the the correct move here? - What other tests are affected by this?
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.
Considering we currently throw a similar exception for the domain, it makes sense to me to continue to throw here.
All apps should now be receiving the
This |
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.
🎩 ed again, OAuth worked correctly for me now.
return_address_with_params(shop: current_shopify_domain, host: host) | ||
rescue ShopifyDomainNotFound, ShopifyHostNotFound |
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.
Considering we currently throw a similar exception for the domain, it makes sense to me to continue to throw here.
This does not work when trying to update a JWT Turbo Example app. Please can you test with that and provide instructions @NabeelAhsen |
no host param comes back. this is URGENT because the review team insist on App Bridge 2. PLEASE HELP. |
Probably worth noting, host is not passed back in the params @paulomarg |
What this PR does
Support App Bridge 2.0 in shopify_app.
Reviewer's guide to testing
Things to focus on
Ensure migration strategy is followed as per the guide.
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