The shopify_app gem only supports usage within a single shop, and should offer a way to support multiple shop sessions at the same time.
If a user logs into an app on a shop, say Shop 1, and then logs in to the app using a different shop, say Shop 2, their session from Shop 1 is cleared and no longer valid.
It is up to app developers to add a layer of authentication on top of the login flow to ensure that a user is seeing data for the correct shop and operating on the correct shop.
The gem should offer a solution to limiting sessions to the current Shop.
shopify_app, this could mean a slower and more tedious upgrade to ensure that their custom overrides still work.Individual Session Paths for each shop:
/shop_id/), and using session paths to create different sessions per session path: https://github.com/Shopify/shopify_app/issues/502#issuecomment-342206871For embedded apps, every request comes with shop, hmac and a few other fields added to the query string. You could imagine using those to load and authenticate the correct shop, instead of the session.
For non-embedded apps, you'd probably want to have the shop id or hostname in url somehow. I don't think that would actually work, though, because AFAIK the app url setting in the partners' dashboard only takes a static url.
Now that I think about it, that's probably why this gem uses the session and cookies for authentication instead of the shop, hmac and timestamp that come with the request for embedded apps - so that it works for non-embedded apps. It would be a nice feature addition to use those for embedded apps though. I bet it would make at least a few merchants happy, since right now it probably seems like an annoying bug to them.
Most helpful comment
For embedded apps, every request comes with
shop,hmacand a few other fields added to the query string. You could imagine using those to load and authenticate the correct shop, instead of the session.For non-embedded apps, you'd probably want to have the shop id or hostname in url somehow. I don't think that would actually work, though, because AFAIK the app url setting in the partners' dashboard only takes a static url.
Now that I think about it, that's probably why this gem uses the session and cookies for authentication instead of the
shop,hmacandtimestampthat come with the request for embedded apps - so that it works for non-embedded apps. It would be a nice feature addition to use those for embedded apps though. I bet it would make at least a few merchants happy, since right now it probably seems like an annoying bug to them.