Hello everyone, I’m currently building a non-embedded app for my company using the remix template.
What the app will do is, prompt the user to install the app, afterwards the app would be redirected offsite.
Before redirecting, I would retrieve the offline access token and use GraphQL to extract some information to be forwarded to the third-party site using the admin object like so:
const { admin, session } = await authenticate.admin(request);
const query = await admin.graphql(`
{
shop {
url
}
}`);
//...
Now, the kicker is when I’m running my project locally (npm run dev), everything is fine, authentication and authorization is done by the Shopify Library, no additional code needed. However, when I tried to use my app in production (npm run build and hosted it), it suddenly says:
"Error: No route matches URL “/admin/oauth/authorize”.
I tried to implement this route by passing the previous request and use it as a parameter for
authenticate.admin. However, it now states:
“[shopify-app/INFO] Could not find a shop, can’t authenticate request”.
I’m actually quite confused why in dev mode I have no such problems, but when in production mode, I would need to implement the auth logic myself.
I need some guidance on what to implement for the “/admin/oauth/authorize” route and how to continue proceeding forward with the app.
Thanks in advance for the help!
