Questions and discussions about using the Shopify CLI and Shopify-built libraries.
Hi there,
I have written an app with node and react for a customer. However I need to update the app scope, but for the life of me I can not figure out how. The documentation is unclear to me: https://shopify.dev/tutorials/authenticate-with-oauth . How do I go about prompting a fresh authorization without removing the app?
Thanks in advance!
I don't think there is a clean way to do this. I've had to email customers and provide them with a new OAuth URL to my app that includes the updated scope. With my app this will update their access token accordingly (which now includes the new scope), and shouldn't show them billing again. If you built yours using Shopify CLI or the stock node / react app from Shopify though, not sure how it will behave.
@Diego_C nonce in my experience isn't actually required, you should be able to manually create the OAuth URL and have it work. Can you paste in an example URL that you're trying to send to the merchant? Are you sure the client_id matches your app's api key?
This is the code I'm using @Filljoy
// Redirect to app with shop parameter upon auth
ctx.redirect(
`https://${shop}/admin/oauth/authorize?client_id=${SHOPIFY_API_KEY}&scope=${SCOPES}&redirect_uri=${redirect}&state=${nonce}&grant_options[]=offline`
);
Yes, I think you're right that it likely has to do with nonce in your case. Did you build this with Shopify CLI? If so, you might be best served asking that by raising a shopify_cli github issue and asking how to do this.
Yes I did, thanks for the tip!