Focuses on API authentication, access scopes, and permission management.
We are starting to now integrate with Shopify using Node/Express, and i'm having issues with the cookie not being there after authentication to verify it.
Context:
hit getShopifyAuthUrl {
shopify_app_session: 'xxxxxxxxxxx',
'shopify_app_session.sig': 'xxxxxxxxxxx',
}
Then in the validate part,
hit validateShopifyToken [Object: null prototype] {}
I have followed the video on: https://shopify.dev/apps/auth/oauth/getting-started and i'm out of ideas on what the issue is.
I have moved the Shopify.Context all over the place to avoid it possibly resetting on each network call, to no avail.
Any ideas?
I have this problem too. It is unclear what the next steps should be to fix this.
I have since moved to not using the SDK, and just using axios, and everything was smooth sailing ever since. Another reason SDKs just aren't worth it in most cases...
URL to redirect them to the authorize page:
How do you get the state query ? can you explain "state=${req.userId}|${req.query.redirect}"
The state query is something that shopify allows you to pass to them, and they will then pass back to you once the request is completed. It is not required. But in my case, users have the ability to auth with shopify via our app, and also discover us in the Shopify app store.
If they did it via our app, they have an account, so once they authed I needed to know who authed so as to save the auth token in our DB to the user who did it.
If they did it via Shopify, req.userId is undefined, so i would send them to our signup where they would either login or signup.
Here is what we're doing with that req.userId
thank you kind sir, your comments are very informative .
so following your comments am trying to create a shopify app without the SDK,
and i have two questions if you could help me:
1- i can subscribe to shopify webhooks using axios and the POST '/webhooks' route gets triggered when subscribed event happen, my question is how to get the webhook body on my route ? req.body is undefined.
2- am planning to allow only known shops to install my app, will that cause the shopify app review to fail ? didn't try tho, still using the development store
with or without reply i want to thanks sir you already been a huge help to me.