Skip to content

Commit 56c3642

Browse files
require peer dep shopify api version 5; update to v2.0.0
1 parent 189b42f commit 56c3642

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ https://www.npmjs.com/package/simple-koa-shopify-auth
66

77
## Description:
88

9-
A better, simplified version of the (no longer supported) [@Shopify/koa-shopify-auth](https://github.com/Shopify/koa-shopify-auth) middleware library. It removes the use of cookies for sessions (which greatly smooths the auth process by requiring fewer redirects in some cases), replaces a deprecated API call, and supports v2 of the official [@shopify/shopify-api](https://github.com/Shopify/shopify-node-api) package.
9+
A better, simplified version of the (no longer supported) [@Shopify/koa-shopify-auth](https://github.com/Shopify/koa-shopify-auth) middleware library. It removes the use of cookies for sessions (which greatly smooths the auth process by requiring fewer redirects in some cases), replaces a deprecated API call, and supports v5 of the official [@shopify/shopify-api](https://github.com/Shopify/shopify-node-api) package.
1010

1111
## Installation:
1212

@@ -16,11 +16,11 @@ npm i simple-koa-shopify-auth
1616

1717
## Requirements:
1818

19-
**This package assumes you have `@shopify/shopify-api` v2 already installed. If you are on v1.x.x you will need to upgrade to the latest version with `npm i @shopify/shopify-api@latest`.**
19+
**This package assumes you have `@shopify/shopify-api` v5 already installed. If you are on a lower version you will need to upgrade to the latest version with `npm i @shopify/shopify-api@latest`.**
2020

2121
#### WARNING:
2222

23-
**`@shopify/shopify-api` v2 has some breaking changes from v1. Please [check the changelog](https://github.com/Shopify/shopify-node-api/blob/v2.0.0/CHANGELOG.md#200---2021-10-28) to see all the changes, and update your code accordingly.**
23+
**Please [check the changelog](https://github.com/Shopify/shopify-api-node/blob/v5.0.1/CHANGELOG.md) to see all the changes, and update your code accordingly.**
2424

2525
## Usage:
2626

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "simple-koa-shopify-auth",
3-
"version": "1.0.6",
3+
"version": "2.0.0",
44
"description": "A better, simplified version of the (no longer supported) @Shopify/koa-shopify-auth middleware library. It removes the use of cookies for sessions (which greatly smooths the auth process), replaces a deprecated API call, and supports v2 of the official @shopify/shopify-api package.",
55
"author": "TheSecurityDev",
66
"license": "MIT",
@@ -32,7 +32,7 @@
3232
"@types/koa": "^2.13.4"
3333
},
3434
"peerDependencies": {
35-
"@shopify/shopify-api": "^2.0.0"
35+
"@shopify/shopify-api": "^5.0.1"
3636
},
3737
"devDependencies": {}
3838
}

src/verify-request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default function verifyRequest(options?: VerifyRequestOptions) {
6565
} catch (err) {
6666
if (
6767
err instanceof HttpResponseError &&
68-
(err.code === 401 || (err as any).response?.code === 401) // Shopify API v3 uses 'response.code' instead of 'code'
68+
((err as any)?.code === 401 || err.response?.code === 401) // Shopify API v3+ uses 'response.code' instead of 'code'
6969
) {
7070
// Session not valid, we will re-authorize
7171
} else {

0 commit comments

Comments
 (0)