Skip to content

Commit 0ee6fa1

Browse files
v2.1.17 - Fix lru cache
1 parent 7a239f6 commit 0ee6fa1

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "simple-koa-shopify-auth",
3-
"version": "2.1.16",
3+
"version": "2.1.17",
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",
@@ -28,7 +28,9 @@
2828
"test": "echo \"Error: no test specified\" && exit 1",
2929
"prepublish": "npm run build"
3030
},
31-
"dependencies": {},
31+
"dependencies": {
32+
"lru-cache": "^9.1.1"
33+
},
3234
"peerDependencies": {
3335
"@shopify/shopify-api": "^5.0.1"
3436
},

src/create-shopify-auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default function createShopifyAuth(options: OAuthBeginConfig) {
6262
}
6363

6464
if (path === oAuthStartPath) {
65-
return await startTopLevelOauthRedirect(ctx, Shopify.Context.API_KEY, topLevelOAuthPath);
65+
return startTopLevelOauthRedirect(ctx, Shopify.Context.API_KEY, topLevelOAuthPath);
6666
}
6767

6868
if (path === oAuthCallbackPath) {

src/verify-request.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Shopify from "@shopify/shopify-api";
22
import { Session } from "@shopify/shopify-api/dist/auth/session";
33
import { HttpResponseError } from "@shopify/shopify-api/dist/error";
44
import { Context, Next } from "koa";
5-
import LRUCache = require("lru-cache");
5+
import { LRUCache } from "lru-cache";
66

77
import { setTopLevelOAuthCookieValue } from "./top-level-oauth-redirect";
88

@@ -55,8 +55,7 @@ export default function verifyRequest(options?: VerifyRequestOptions) {
5555
await checkSessionOnShopifyAPI(session); // Throws a 401 error if the access token is invalid
5656
// If we get here, the session is valid
5757
setTopLevelOAuthCookieValue(ctx, null); // Clear the cookie
58-
await next();
59-
return;
58+
return next();
6059
}
6160
} catch (err) {
6261
if (

0 commit comments

Comments
 (0)