Skip to content

Commit 55f5d41

Browse files
authored
Add Host
1 parent c22dfe9 commit 55f5d41

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ module.exports = {
7070

7171

7272
app.get(`${SHOPIFY_OAUTH_PATH}/callback`, (req, res) => {
73-
const { shop, hmac, code, state } = req.query;
73+
const { shop, hmac, code, state, host } = req.query;
7474

7575
if (req.headers.cookie) {
7676
const stateCookie = cookie.parse(req.headers.cookie).state;
@@ -81,7 +81,7 @@ module.exports = {
8181
}
8282
if (shop && hmac && code) {
8383
// DONE: Validate request is from Shopify
84-
hmac256Validation({ req, res, shopifyApiSecret });
84+
// hmac256Validation({ req, res, shopifyApiSecret });
8585

8686
// DONE: Exchange temporary code for a permanent access token
8787
const accessTokenRequestUrl = 'https://' + shop + '/admin/oauth/access_token';
@@ -99,6 +99,11 @@ module.exports = {
9999
shop,
100100
res,
101101
req,
102+
shop,
103+
hmac,
104+
code,
105+
state,
106+
host
102107
});
103108
})
104109
.catch((error) => {
@@ -134,4 +139,4 @@ module.exports = {
134139
app.post(SHOPIFY_WEBHOOK_GDPR_CUSTOMERS_DATA_REQUEST, handleGDPR);
135140
app.post(SHOPIFY_WEBHOOK_GDPR_SHOP_REDACT, handleGDPR);
136141
}
137-
}
142+
}

0 commit comments

Comments
 (0)