Closed Steven4294 closed 1 year ago
Happens to me as well. Tracing the code now.
I have discovered a bug :
(!session.expires || session.expires >= new Date())
Must be
(!session.expires || +(new Date(session.expires)) >= +(new Date()))
Especially if our session storage is Redis (as it serializes to string).
I'll try to issue a pull request for this.
Hey @Steven4294, it seems like you're mounting the GraphQL proxy as your root at/shopifyapp
, which is what the Admin page will try to load (as per your settings). You'll need a different root endpoint, that redirects the user to /shopifyapp/auth?shop=XYZ
if they haven't performed OAuth yet, or loads the app 'skeleton' to build your App Bridge client.
Unfortunately we don't have an example specifically for next.js, but our Koa tutorial might help here - step 7 in the linked section may be helpful for your case.
Hope this helps!
Note that this repo is no longer maintained and this issue will not be reviewed. Prefer the official JavaScript API library. If you still want to use Koa, see simple-koa-shopify-auth for a potential community solution.
Is there an example of a project using
next.js
and an app-prefix (which is required to usenext.js
api routes)? As is, can't seem to get the app prefix stuff to work.Then for my app url I do
https://853e7.ngrok.io/shopifyapp
within the partners dashboardHere are my logs: