@sommpicks/sommpicks-shopify 24.12.6 → 24.12.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -32,7 +32,7 @@ export class ShopifyRouter {
|
|
|
32
32
|
const hmac = expresRequest.query.hmac as string;
|
|
33
33
|
const code = expresRequest.query.code as string;
|
|
34
34
|
const host = expresRequest.query.host as string;
|
|
35
|
-
|
|
35
|
+
Logger.info(`ShopifyRouter - callBackRoute From shopify ${code}`);
|
|
36
36
|
if (shop && hmac && code) {
|
|
37
37
|
const map = Object.assign({}, expresRequest.query);
|
|
38
38
|
delete map['signature'];
|
|
@@ -42,7 +42,7 @@ export class ShopifyRouter {
|
|
|
42
42
|
|
|
43
43
|
const hashEquals = this.cryptoService.checkHash(this.cryptoService.generateHash(message, this.shop_secret), hmac);
|
|
44
44
|
if (!hashEquals) { expresResponse.status(401).send('HMAC validation failed'); return; }
|
|
45
|
-
|
|
45
|
+
Logger.info(`getOathToken From shopify ${code}`);
|
|
46
46
|
OauthService.getOathToken(shop, this.shop_key, this.shop_secret, code,
|
|
47
47
|
(accessToken: string) => {
|
|
48
48
|
this.callback(accessToken, shop, host, expresResponse, secFetchDest === 'iframe', null);
|
|
@@ -63,12 +63,11 @@ export class ShopifyRouter {
|
|
|
63
63
|
const shop = expresRequest.query.shop as string;
|
|
64
64
|
const host = expresRequest.query.host;
|
|
65
65
|
if (shop) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
expresResponse.redirect(this.installUrl(shop, scopes));
|
|
66
|
+
if(!expresRequest.query.session) {
|
|
67
|
+
expresResponse.render('session_expire', { redirectUrl: this.installUrl(shop, scopes) });
|
|
68
|
+
} else {
|
|
69
|
+
expresResponse.redirect(`${this.appBaseUrl}/billing/created?host=${host}&shop=${shop}&status=already_accepted`);
|
|
70
|
+
}
|
|
72
71
|
} else {
|
|
73
72
|
return expresResponse.status(400).send('Missing shop parameter.');
|
|
74
73
|
}
|