Open NguyenQuangHuy282002 opened 6 months ago
Also experiencing this
fwiw, I'm seeing this being logged if I set logger: { level: LogSeverity.Debug }
[shopify-app/DEBUG] App is not embedded, redirecting to Shopify | {shop:{redacted}.myshopify.com}
But the app IS embedded
I ran across this issue, this whole product is just unfinished and buggy unfortunately. Every app we develop, we run into issues directly related to the framework Shopify is suggesting to use... super frustrating.
In this case, I decided to spin up a new app just to see if that would resolve the issue, via npm run dev -- --reset
and going through the steps to setup a new app.
I then went onto the existing app's configuration page in the Partners portal, and compared it to the new app that was just setup. I noticed the old app had no scopes section in the partners page, the new app did. So something has been changed along the way, unsure what.
However, creating a new app did resolve the issue.
Additionally, the root issue appears to be the installation URL provided under Distribution, did not end up containing a ?embedded=1
URL param as part of the install/redirects, which caused it to think it was not embedded (node_modules/@shopify/shopify-app-remix/build/cjs/server/authenticate/admin/helpers/ensure-app-is-embedded-if-required.js -- line 15
).
So, try creating a new app.
I'm also experiencing this issue :( I've just created a new application and the afterAuth is not fired. I'm not sure why.
EDIT: ok turns out I had to delete my local sqlite db and delete the session. Afterwards, the afterAuth
was run correctly.
I'm also experiencing this issue :( I've just created a new application and the afterAuth is not fired. I'm not sure why.
EDIT: ok turns out I had to delete my local sqlite db and delete the session. Afterwards, the
afterAuth
was run correctly.
This saved my day!
We're labeling this issue as stale because there hasn't been any activity on it for 60 days. While the issue will stay open and we hope to resolve it, this helps us prioritize community requests.
You can add a comment to remove the label if it's still relevant, and we can re-evaluate it.
Hi everyone,
I encountered the same issue where the afterAuth callback wasn't running when installing the app. In my case, the problem was related to session saved in the db. Since I was using EventBridge instead of HTTP delivery method, I forgot to delete the session from the db once the shop uninstalls the app, causing this issue.
Here's what I found:
webhooks.jsx
switch (topic) {
case "APP_UNINSTALLED":
if (session) {
await db.session.deleteMany({ where: { shop } }); // This line removes the session from db
}
break;
After making this change, the afterAuth callback ran as expected after the app was installed.
I hope this helps others facing the same issue!
Issue summary
Expected behavior
Run afterAuth callback after installed
Actual behavior
Not run afterAuth callback after installed, however, run it when navigating to other routes in app
Steps to reproduce the problem