Comments (7)
For some context, this is the issue I'm facing. Somewhat confusingly it does this about 50% of the time, the other 50% the host is correct and the app works as expected.
from simple-koa-shopify-auth.
I just published the new package v1.0.5, so I'll go ahead and close this. The new version uses Shopify.Context.HOST_NAME
instead, so you don't have to pass in the host name or anything. I suspect the issue would also have been solved by enabling Koa proxy as I mentioned, but this would fix any future issues other people may have like this.
from simple-koa-shopify-auth.
This was taking me too long looking for a workaround trying to use koa-proxies and stuff like that. Have added a PR which solves this issue, if you could review #6
from simple-koa-shopify-auth.
So I was making a few minor changes to your PR, when I had the idea that instead of using ctx.host
and instead of passing in the host name, we should use the host specified on Shopify.Context.HOST_NAME
. Is that the same as the host you are passing in and would that work in your case?
from simple-koa-shopify-auth.
Also, have you tried initializing your Koa server like this:
new Koa({ proxy: true });
I had to do this for ngrok and heroku so I could get the client's IP address correctly, so maybe it's a similar situation with getting the host header.
from simple-koa-shopify-auth.
That's a good idea. Yeah, I am passing that same string as pulled from the .env so that should work in my case.
createShopifyAuth({
accessMode: "online",
authPath: "/auth",
host: config.shopify.HOST_NAME,
from simple-koa-shopify-auth.
Also, have you tried initializing your Koa server like this:
new Koa({ proxy: true });
I had to do this for ngrok and heroku so I could get the client's IP address correctly, so maybe it's a similar situation with getting the host header.
I have not, but we've just resubmitted the app for listing after using the forked version of this package, so just going to wait on a reply from Shopify now before making more changes.
from simple-koa-shopify-auth.
Related Issues (16)
- App bridge error after redirect in pages HOT 1
- Getting Context Initialize error HOT 4
- Latest version (2.1.4) doesn't use the host param when calling createApp in top-level-oauth-redirect.ts HOT 3
- ReferenceError: btoa is not defined HOT 5
- Supporting latest version of `@shopify/shopify-api` (version 6) HOT 13
- How to make it work with koa-mount? HOT 2
- Validate the request from Frontend
- Shopify graphQL proxy HOT 4
- LRUCache is not a constructor HOT 3
- Session creation is not working HOT 9
- The host is undefined HOT 12
- Reauth on Client Side HOT 2
- "The app couldn't be loaded" error HOT 12
- Shopify.utils.validateShop has been deprecated HOT 3
- "Internal Server Error" message when first time installed an app, but app works fine after reload page. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple-koa-shopify-auth.