I forgot to add scopes to my App configuration, so when i installed it in the Merchant store, it had no scopes. My TOML file had scopes, and I deployed, but apparently, not having the scopes in the App config (Shopify App - Ruby) is where you actually have to place scopes.
So I placed in my scopes, and then reloaded the App. I then had to append /login to the App to bring up the nag screen about approving the new scopes…
What is the better way to deal with this? I used to delete a cookie but that no longer works. What’s the quick trick to forcing an App to re-auth Scopes without uninstalling and re-installing?
What does your access_scopes
section look like? Do you have use_legacy_install_flow
set?
As long as you don’t have that set, Shopify should determine that the scopes have changed and prompt the merchant when loading the app.
Access scopes in the TOML file make no difference. The before/after remain the same.
[access_scopes]
scopes = "read_products, write_shipping"
use_legacy_install_flow = true
But since the Shopify App Config block had scopes as an empty string, the App installed without the TOML scopes. Making the whole CLI deploy aspect useless. Which is the point of my question. Since the CLI is no help here, what would be a good alternative to forcing the scope changes to take effect for an unsuspecting merchant.
Agreed that filling in the scopes is pretty useless if you have use_legacy_install_flow
enabled. Why do you need that? It should be simpler for you if you take that out and let Shopify manage prompting the merchant for you (managed install). See: Enable Shopify-managed installations for your app
True. But you see how confusing this is having both and then expecting the managed version to at least do something useful! But point taken. Still. My question remains unanswered on how to force an installed App that gets new Scopes (any scopes) to show the nag screen to a merchant.
The recommended way to ensure the merchant is prompted for new scopes is to use managed install by removing the use_legacy_install_flow
setting (or setting it to false
). The link I pasted above describes how to migrate to managed install.
Is there a reason that wouldn’t work for you? If you’re using the shopify_app
gem it shouldn’t be too bad!
The simple reason is just me not being confident it works. I have plenty of anecdotal stories of problems with managed install. It was rolled out, crashed, and caused problems. While it is certainly better today, of that I am sure, I am reluctant to change patterns of use until I am certain it works. In the case of this App, I can likely tweak the pattern to no ill effect, but on my older established Apps, the last thing I want to do is switch to managed install and have NEW problems.