I'm having a very similar issue to ctrlaltdylan/shopify-nextjs-toolbox#13, using the latest version of this repo. I have written a simple saveNonce function and am exporting it with export default handleAuthStart({ saveNonce }); at the bottom of api/auth.js
I then try to install it into the shopify dev store and it redirects to a strange url (as described in the issue above):
https://<store>.myshopify.com/admin/apps/<appid>/?hmac=<hmac>&host=<hostid>&shop=<store>.myshopify.com×tamp=1652701151 (senitive parts omitted in <>)
Whereby shopify give an error on the page
There’s no page at this address
Check the URL and try again, or use the search bar to find what you need.
Checking the vercel function logs, I can see clearly the POST requests to /api/auth were successful, and logging shows the nonce was added to the database correctly.
What is strange is that removing the saveNonce, the app functions perfectly. So the question is - why is saveNonce causing it to do this?
Any ideas why? I've looked at the code for handleAuthStart and am stumped as to why it is doing this.
Side note - great starter app. First one so far that has actually worked and not super out of date ❤️
I'm having a very similar issue to ctrlaltdylan/shopify-nextjs-toolbox#13, using the latest version of this repo. I have written a simple
saveNoncefunction and am exporting it withexport default handleAuthStart({ saveNonce });at the bottom ofapi/auth.jsI then try to install it into the shopify dev store and it redirects to a strange url (as described in the issue above):
https://<store>.myshopify.com/admin/apps/<appid>/?hmac=<hmac>&host=<hostid>&shop=<store>.myshopify.com×tamp=1652701151(senitive parts omitted in <>)Whereby shopify give an error on the page
Checking the vercel function logs, I can see clearly the
POSTrequests to/api/authwere successful, and logging shows the nonce was added to the database correctly.What is strange is that removing the
saveNonce, the app functions perfectly. So the question is - why issaveNoncecausing it to do this?Any ideas why? I've looked at the code for handleAuthStart and am stumped as to why it is doing this.
Side note - great starter app. First one so far that has actually worked and not super out of date ❤️