Skip to content
This repository has been archived by the owner on May 31, 2019. It is now read-only.

👍 update for new shopify-express api #95

Merged
merged 4 commits into from
Mar 23, 2018

Conversation

marutypes
Copy link
Contributor

Please try this out on your own dev stores :)

@AWaselnuk
Copy link
Contributor

I can't 🎩because my redirect_uri is not whitelisted during the oauth dance. In other words the way I was setting up a proxy to localhost seems to suddenly not work.

I'll try again tomorrow :(

Copy link

@lopert lopert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having issues during 🎩where the redirect_uri slashes are being converted?
&redirect_uri=https%3A%2F%2Falexbradley.ngrok.io%2F%2Fshopify%2Fauth%2Fcallback

The readme whitelist URL instruction needs to be changed to the new redirect
Set the whitelisted URL to {{ HOST }}/shopify/auth/callback

@marutypes
Copy link
Contributor Author

Ok, thanks, I'll take a look at this again tonight or tommorrow morning

@marutypes
Copy link
Contributor Author

@AWaselnuk @lopert is right that we need to also change the README, so that's probably why your whitelist is wrong.

@lopert You're right that the readme needs updating, but I'm not seeing issues with the escaping locally. We should chat about how this is set up for you. For me it works fine with latest @shopify/shopify-express

@jamiemtdwyer
Copy link
Contributor

&redirect_uri=https%3A%2F%2Falexbradley.ngrok.io%2F%2Fshopify%2Fauth%2Fcallback

If you mean this is what appears in your address bar during the OAuth grant screen, this is actually intended. The URI should be escaped since it's being passed as a URL param. Shopify knows that it should unescape it on its side.

Copy link
Contributor

@AWaselnuk AWaselnuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed my callback URL and the auth dance now works fine.

But we need to update our demo app code to send API calls to the right endpoint. If you load it up and try to use the form to GET /products.json it returns 404 because it looks at /api/products.json. We should be sending requests to /shopify/api/products.json

screen shot 2018-03-15 at 11 04 16 am

@AWaselnuk
Copy link
Contributor

Sidenote: our UI demo is pretty lame - we don't even display a flash or UI message of any kind when you get a 404. It would be so great if someone could tackle #75

@marutypes
Copy link
Contributor Author

@AWaselnuk updated the URL

Copy link
Contributor

@AWaselnuk AWaselnuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you left some debugging artifacts lying around. Fix that up and ship it :)

afterAuth(request, response) {
const { session: { accessToken, shop } } = request;

// registerWebhook(shop, accessToken, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove these comments + console.log?

@marutypes marutypes force-pushed the update/shopify-express-callback-url-fix branch from 946cd69 to 04c6a63 Compare March 21, 2018 17:20
@marutypes marutypes merged commit 4a00124 into master Mar 23, 2018
@marutypes marutypes deleted the update/shopify-express-callback-url-fix branch March 23, 2018 19:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants