Thanks a lot. I have fixed it
We have figured this one out. The tutorial doesn't make it obvious but Shopify seems to check for an auth loop whenever the root url ('/') of the application is accessed.
The tutorial has code like the following:See the ctx.redirect('/') there? That's the offending piece of code. In trying to check for a loop, Shopify is incorrectly flagging a legitimate access url access as a bad one.
It's quite simple. Never redirect to root in your application. Move the main page of your app to something like '/home' and do this instead:ctx.redirect('/home');
Make sure that the route home is available and you are good to go.
Shopify should probably update their docs to mention this.
I have been with stuck with the same problem for over a week. I cannot seem to find a solution. I am not using koa so, I don't have same ctx.redirect in my codebase. I am using node.js and express.js and following this tutorial. https://help.shopify.com/en/api/tutorials/build-a-shopify-app-with-node-and-express
Would you be able to provide a hint on where I would need to fix the redirect issue with the above tutorial?
In the tutorial you mentioned, you need to replace
The above statement ends your response with a json response without redirecting anywhere.
with the following after requesting access token from shopify
And make sure to serve the route '/home'.
Hope this works!
|an hour ago|
|an hour ago|