App 302 - Request from storefront to nextjs endpoint (possibly unauthenticated)

New Member
4 0 0

Hi guys, running into an issue for my Shopify app. I'm using Next.js, React.js, Node and polaris.

One of my next.js endpoints is requested on load of a shopify storefront. It has been giving a status 200 and returning data while I was working in development. However, since a client has installed my app when their stores make the same request I get 302. (app is hosted externally on Heroku)

I've analysed the differences in both requests and it looks like the main difference is that the request from my test store has a full koa Shopify cookie in the request while my clients request does not.

I thought this was odd, so I logged out of my test development store and instead visited it on incognito window and saw that it was also receiving a 302.

This is obviously problematic for a client wanting to use my app. The app invokes some logic by getting data from that endpoint when a customer visits the store so obviously, they are not logged in either so the request is also sent without koa info.

Perhaps I need to configure this particular nextjs endpoint to not expect koa cookie auth. But I'm not sure how to do that at the moment

Any help would be greatly appreciated