App proxy API authentication

I created a simple app proxy API following Shopify’s documentation. Everything worked fine in the DEV environment, but the App proxy requests do not work until I have re-opend the app in the store . So even if I make any changes then it stops the app proxy admin api requests to work.
I believe it’s related to the session. But in my app, I already configured it to use offline token.”

Below is Sample Code of what I am using
Any help would be greatly appreciated


export const loader: LoaderFunction = async ({ request }) => {
  try {
    const { admin, session } = await authenticate.public.appProxy(request);
    if (!admin) {
      return json({ error: "Admin not found" }, { status: 401 });
    }
    ...
}

Hi @Vinh_Tran - I haven’t been in that exact situation before, but one possible reason I can think of is session storage. If you’re using SQLite in production, it may not persist between requests on most of the hosting platforms, which could explain why it only works after reopening the app.

1 Like