App 'UseAuthenticatedFetch' Issues - throws 403 Forbidden error

I am encountering some issues when I host a version of my custom Shopify app to test. It works perfectly fine when run locally using the ‘npm run dev’ command, but when I build and host the app, I run into problems.

I am able to install the hosted version of the app on a development store, and the frontend displays without any issues. Additionally, the store appears in the ‘installed stores’ list. However, when I attempt to use anything that utilizes the ‘useAuthenticatedFetch’ call for the API, the API throws a 403 Forbidden error. The same API works fine locally, but after building and running the code in production, it causes the error.

I have previously worked on two other app project structures, and it worked fine. I have never encountered this issue before.

Has anyone else come across this issue?

Hi @SADIK112 ,

Please make sure .env has appropriate permissions in access_scope. Environment and app configuration in partner dashboard should match. Also make sure those permissions were granted when installing your app

Hi added the same environment scope locally as well as in production. locally it seems to work fine. in production getting forbidden 403 error

Try deleting any Shopify session in production.

Hi @AchieveApplabs

Facing the same issue of 403 Forbidden error while requesting anything from the backend. It sets the bearer token perfectly on to the request headers. Also while validating the session token from the backend it’s giving the error saying session not valid and forwarding to reauthorize the app. Can you please help it solving this issues and making it work?