diff --git a/examples/nextjs-clerk-rate-limit/app/api/arcjet/route.ts b/examples/nextjs-clerk-rate-limit/app/api/arcjet/route.ts index 282080bbb..873c07200 100644 --- a/examples/nextjs-clerk-rate-limit/app/api/arcjet/route.ts +++ b/examples/nextjs-clerk-rate-limit/app/api/arcjet/route.ts @@ -50,7 +50,7 @@ export async function GET(req: NextRequest) { }) ); - const fingerprint = ip(req); + const fingerprint = ip(req) || "127.0.0.1"; // Fall back to local IP if none // Deduct 5 tokens from the token bucket decision = await rl.protect(req, { fingerprint, requested: 5 }); @@ -67,19 +67,15 @@ export async function GET(req: NextRequest) { status: 429, } ); - } else { - // Detected a bot - return NextResponse.json( - { - error: "Forbidden", - reason: decision.reason, - }, - { - status: 403, - } - ); } } + + let reset: Date | undefined; + let remaining: number | undefined; + + if (decision.reason.isRateLimit()) { + reset = decision.reason.resetTime; + remaining = decision.reason.remaining; + } - return NextResponse.json({ message: "Hello World" }); -} + return NextResponse.json({ message: "Hello World", reset, remaining });} \ No newline at end of file diff --git a/examples/nextjs-clerk-rate-limit/app/api/token/route.ts b/examples/nextjs-clerk-rate-limit/app/api/token/route.ts index afb7621f7..7b3694039 100644 --- a/examples/nextjs-clerk-rate-limit/app/api/token/route.ts +++ b/examples/nextjs-clerk-rate-limit/app/api/token/route.ts @@ -5,11 +5,9 @@ import { auth } from "@clerk/nextjs/server"; export async function GET(req: Request) { - const { userId, getToken } = await auth(); + const { userId, getToken, redirectToSignIn } = await auth(); - if (!userId) { - return new Response("Unauthorized", { status: 401 }); - } + if (!userId) return redirectToSignIn() try { const token = await getToken(); diff --git a/examples/nextjs-clerk-rate-limit/middleware.ts b/examples/nextjs-clerk-rate-limit/middleware.ts index 908a364db..30dbd86f8 100644 --- a/examples/nextjs-clerk-rate-limit/middleware.ts +++ b/examples/nextjs-clerk-rate-limit/middleware.ts @@ -3,7 +3,7 @@ import { NextResponse } from "next/server"; const isProtectedRoute = createRouteMatcher(["/api/private", "/api/token"]); -export default clerkMiddleware((auth, request) => { +export default clerkMiddleware(async (auth, request) => { if (isProtectedRoute(request)) { auth.protect(); } diff --git a/examples/nextjs-clerk-rate-limit/package-lock.json b/examples/nextjs-clerk-rate-limit/package-lock.json index 9dca0a0c2..a0906bb12 100644 --- a/examples/nextjs-clerk-rate-limit/package-lock.json +++ b/examples/nextjs-clerk-rate-limit/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.0", "dependencies": { "@arcjet/next": "file:../../arcjet-next", - "@clerk/nextjs": "^6.4.1", + "@clerk/nextjs": "^6.5.0", "next": "15.0.3", "react": "^18", "react-dom": "^18" @@ -28,21 +28,21 @@ }, "../../arcjet-next": { "name": "@arcjet/next", - "version": "1.0.0-alpha.30", + "version": "1.0.0-alpha.31", "license": "Apache-2.0", "dependencies": { - "@arcjet/env": "1.0.0-alpha.30", - "@arcjet/headers": "1.0.0-alpha.30", - "@arcjet/ip": "1.0.0-alpha.30", - "@arcjet/logger": "1.0.0-alpha.30", - "@arcjet/protocol": "1.0.0-alpha.30", - "@arcjet/transport": "1.0.0-alpha.30", - "arcjet": "1.0.0-alpha.30" + "@arcjet/env": "1.0.0-alpha.31", + "@arcjet/headers": "1.0.0-alpha.31", + "@arcjet/ip": "1.0.0-alpha.31", + "@arcjet/logger": "1.0.0-alpha.31", + "@arcjet/protocol": "1.0.0-alpha.31", + "@arcjet/transport": "1.0.0-alpha.31", + "arcjet": "1.0.0-alpha.31" }, "devDependencies": { - "@arcjet/eslint-config": "1.0.0-alpha.30", - "@arcjet/rollup-config": "1.0.0-alpha.30", - "@arcjet/tsconfig": "1.0.0-alpha.30", + "@arcjet/eslint-config": "1.0.0-alpha.31", + "@arcjet/rollup-config": "1.0.0-alpha.31", + "@arcjet/tsconfig": "1.0.0-alpha.31", "@jest/globals": "29.7.0", "@rollup/wasm-node": "4.27.3", "@types/node": "18.18.0", @@ -57,6 +57,25 @@ "next": ">=13" } }, + "../../ip": { + "name": "@arcjet/ip", + "version": "1.0.0-alpha.31", + "extraneous": true, + "license": "Apache-2.0", + "devDependencies": { + "@arcjet/eslint-config": "1.0.0-alpha.31", + "@arcjet/rollup-config": "1.0.0-alpha.31", + "@arcjet/tsconfig": "1.0.0-alpha.31", + "@jest/globals": "29.7.0", + "@rollup/wasm-node": "4.27.3", + "@types/node": "18.18.0", + "jest": "29.7.0", + "typescript": "5.6.3" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@alloc/quick-lru": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", @@ -74,12 +93,13 @@ "link": true }, "node_modules/@clerk/backend": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/@clerk/backend/-/backend-1.17.1.tgz", - "integrity": "sha512-gfjdLILCVdt0wOuFlv0QwYcdNR1dR7VkwhzZV8y4zhcF95AalzIQaBH3vUsOzlOxieBsuuB+dS1ZauHAwGFdgg==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/@clerk/backend/-/backend-1.18.0.tgz", + "integrity": "sha512-FIGBtr8qIgS+NbovKcLOIg8BsQj1JaykW3VKft3H83tONQD5Rg9ENXj/JX1HyZGC3ixLv5BUxu4bihQ78L/gJQ==", + "license": "MIT", "dependencies": { - "@clerk/shared": "2.16.0", - "@clerk/types": "4.34.1", + "@clerk/shared": "2.17.0", + "@clerk/types": "4.35.0", "cookie": "0.7.0", "snakecase-keys": "5.4.4", "tslib": "2.4.1" @@ -89,12 +109,13 @@ } }, "node_modules/@clerk/clerk-react": { - "version": "5.16.1", - "resolved": "https://registry.npmjs.org/@clerk/clerk-react/-/clerk-react-5.16.1.tgz", - "integrity": "sha512-CTXn4RlNLxZxrohtbmkpsZFwmE51J10ErcLXCnwNjyN0gBz0xX9fJapysGhSR3osrZASaIzmrP8/bCTnNvs7Sg==", + "version": "5.17.0", + "resolved": "https://registry.npmjs.org/@clerk/clerk-react/-/clerk-react-5.17.0.tgz", + "integrity": "sha512-++PSiayBaK877XTjbTZzyqommVlxnFNevxCKsOXbq8+KENAyYkUZ6LJpyoWjfjg1fnKq6oUFax+TwnyOyyxoqw==", + "license": "MIT", "dependencies": { - "@clerk/shared": "2.16.0", - "@clerk/types": "4.34.1", + "@clerk/shared": "2.17.0", + "@clerk/types": "4.35.0", "tslib": "2.4.1" }, "engines": { @@ -106,14 +127,15 @@ } }, "node_modules/@clerk/nextjs": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@clerk/nextjs/-/nextjs-6.4.1.tgz", - "integrity": "sha512-dmHCQMlqrdVLIKG0xO5oRsAbwjETRM5eW7wUlhTJEp3XUZYJUggR838Vupj/1sLaCJxcFWNDobgKw/MdEKT5Ng==", - "dependencies": { - "@clerk/backend": "1.17.1", - "@clerk/clerk-react": "5.16.1", - "@clerk/shared": "2.16.0", - "@clerk/types": "4.34.1", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@clerk/nextjs/-/nextjs-6.5.0.tgz", + "integrity": "sha512-0+MhX4Hz/fdvVYeZIC7XNI8qZ7vX+UtfMksE6qdyWR5IGewCsNiIHlDW0fDtau6p1e6TsQ66qTnZz15yU4G7dw==", + "license": "MIT", + "dependencies": { + "@clerk/backend": "1.18.0", + "@clerk/clerk-react": "5.17.0", + "@clerk/shared": "2.17.0", + "@clerk/types": "4.35.0", "crypto-js": "4.2.0", "ezheaders": "0.1.0", "server-only": "0.0.1", @@ -129,12 +151,13 @@ } }, "node_modules/@clerk/shared": { - "version": "2.16.0", - "resolved": "https://registry.npmjs.org/@clerk/shared/-/shared-2.16.0.tgz", - "integrity": "sha512-JM5GZcrnvppV+06v5ebsjTI5vGQFGI6TlrLiAHAfcOo/numCDR3EN5MWQW27kD09bsrRtgBNsPiejTpMqXGWjA==", + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/@clerk/shared/-/shared-2.17.0.tgz", + "integrity": "sha512-Jn/oBGjGfQQJIiMMf6Y0puC62R0rL1l/gLoPWnO6vNlCBzuFHGcsSTCWWDpmAXfyVwY7wJ7Dcq/B1UEsKeJ8zQ==", "hasInstallScript": true, + "license": "MIT", "dependencies": { - "@clerk/types": "4.34.1", + "@clerk/types": "4.35.0", "dequal": "2.0.3", "glob-to-regexp": "0.4.1", "js-cookie": "3.0.5", @@ -158,9 +181,10 @@ } }, "node_modules/@clerk/types": { - "version": "4.34.1", - "resolved": "https://registry.npmjs.org/@clerk/types/-/types-4.34.1.tgz", - "integrity": "sha512-FaeHmmoZkIrPrU6AOJ8FUke+LM8ZH072w0Aog6kbQGL3bCBZgUGFy7faTzozxbd+TWTbzVDoTAbDeZCq21UOFg==", + "version": "4.35.0", + "resolved": "https://registry.npmjs.org/@clerk/types/-/types-4.35.0.tgz", + "integrity": "sha512-sBSYCCIXcwI+JHQRqBtskw10+rQ1NcA9w1G6ndnS48F5C+if6xI9OpYaaDjhhvzLjBeZFydKAOhe35mgC7bmoA==", + "license": "MIT", "dependencies": { "csstype": "3.1.1" }, @@ -1839,6 +1863,7 @@ "version": "0.7.0", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.0.tgz", "integrity": "sha512-qCf+V4dtlNhSRXGAZatc1TasyFO6GjohcOul807YOb5ik3+kQSnb4d7iajeCL8QHaJ4uZEjCgiCJerKXwdRVlQ==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -1998,6 +2023,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "license": "MIT", "engines": { "node": ">=6" } @@ -2052,6 +2078,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "license": "MIT", "dependencies": { "no-case": "^3.0.4", "tslib": "^2.0.3" @@ -2993,7 +3020,8 @@ "node_modules/glob-to-regexp": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==" + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "license": "BSD-2-Clause" }, "node_modules/glob/node_modules/brace-expansion": { "version": "2.0.1", @@ -3685,6 +3713,7 @@ "version": "3.0.5", "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.5.tgz", "integrity": "sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==", + "license": "MIT", "engines": { "node": ">=14" } @@ -3845,6 +3874,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "license": "MIT", "dependencies": { "tslib": "^2.0.3" } @@ -3862,6 +3892,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "license": "MIT", "engines": { "node": ">=8" }, @@ -4046,6 +4077,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "license": "MIT", "dependencies": { "lower-case": "^2.0.2", "tslib": "^2.0.3" @@ -4969,6 +5001,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", + "license": "MIT", "dependencies": { "dot-case": "^3.0.4", "tslib": "^2.0.3" @@ -4978,6 +5011,7 @@ "version": "5.4.4", "resolved": "https://registry.npmjs.org/snakecase-keys/-/snakecase-keys-5.4.4.tgz", "integrity": "sha512-YTywJG93yxwHLgrYLZjlC75moVEX04LZM4FHfihjHe1FCXm+QaLOFfSf535aXOAd0ArVQMWUAe8ZPm4VtWyXaA==", + "license": "MIT", "dependencies": { "map-obj": "^4.1.0", "snake-case": "^3.0.4", @@ -4991,6 +5025,7 @@ "version": "2.19.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=12.20" }, @@ -5009,7 +5044,8 @@ "node_modules/std-env": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.8.0.tgz", - "integrity": "sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==" + "integrity": "sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==", + "license": "MIT" }, "node_modules/streamsearch": { "version": "1.1.0", @@ -5305,6 +5341,7 @@ "version": "2.2.5", "resolved": "https://registry.npmjs.org/swr/-/swr-2.2.5.tgz", "integrity": "sha512-QtxqyclFeAsxEUeZIYmsaQ0UjimSq1RZ9Un7I68/0ClKK/U3LoyQunwkQfJZr2fc22DfIXLNDc2wFyTEikCUpg==", + "license": "MIT", "dependencies": { "client-only": "^0.0.1", "use-sync-external-store": "^1.2.0" @@ -5607,6 +5644,7 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.2.tgz", "integrity": "sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw==", + "license": "MIT", "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } diff --git a/examples/nextjs-clerk-rate-limit/package.json b/examples/nextjs-clerk-rate-limit/package.json index 166906da7..540188032 100644 --- a/examples/nextjs-clerk-rate-limit/package.json +++ b/examples/nextjs-clerk-rate-limit/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@arcjet/next": "file:../../arcjet-next", - "@clerk/nextjs": "^6.4.1", + "@clerk/nextjs": "^6.5.0", "next": "15.0.3", "react": "^18", "react-dom": "^18" @@ -26,4 +26,4 @@ "tailwindcss": "^3.4.15", "typescript": "^5" } -} +} \ No newline at end of file diff --git a/examples/nextjs-clerk-shield/middleware.ts b/examples/nextjs-clerk-shield/middleware.ts index 3f8efc233..7ff3d6b59 100644 --- a/examples/nextjs-clerk-shield/middleware.ts +++ b/examples/nextjs-clerk-shield/middleware.ts @@ -1,4 +1,4 @@ -import arcjet, { createMiddleware, shield } from "@arcjet/next"; +import arcjet, { shield } from "@arcjet/next"; import { clerkMiddleware, createRouteMatcher } from "@clerk/nextjs/server"; import { NextResponse } from "next/server"; @@ -9,16 +9,6 @@ export const config = { matcher: ["/((?!.+\\.[\\w]+$|_next).*)", "/", "/(api|trpc)(.*)"], }; -const isProtectedRoute = createRouteMatcher(["/api/private"]); - -const clerk = clerkMiddleware((auth, request) => { - if (isProtectedRoute(request)) { - auth.protect(); - } - - return NextResponse.next(); -}); - const aj = arcjet({ // Get your site key from https://app.arcjet.com // and set it as an environment variable rather than hard coding. @@ -32,7 +22,20 @@ const aj = arcjet({ ], }); -// Clerk middleware will run after the Arcjet middleware. You could also use -// Clerk's beforeAuth options to run Arcjet first. See -// https://clerk.com/docs/references/nextjs/auth-middleware#use-before-auth-to-execute-middleware-before-authentication -export default createMiddleware(aj, clerk); \ No newline at end of file +const isProtectedRoute = createRouteMatcher(["/api/private"]); + +// Arcjet runs first to protect all routes defined in the matcher config above. +// Then if the request is allowed, Clerk runs +export default clerkMiddleware(async (auth, req) => { + const decision = await aj.protect(req); + + if (decision.isDenied()) { + return NextResponse.json({ error: "Unauthorized" }, { status: 403 }); + } + + if (isProtectedRoute(req)) { + await auth.protect(); + } + + return NextResponse.next(); +}); \ No newline at end of file diff --git a/examples/nextjs-clerk-shield/package-lock.json b/examples/nextjs-clerk-shield/package-lock.json index 2e0215c20..1457a6132 100644 --- a/examples/nextjs-clerk-shield/package-lock.json +++ b/examples/nextjs-clerk-shield/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.0", "dependencies": { "@arcjet/next": "file:../../arcjet-next", - "@clerk/nextjs": "^6.4.1", + "@clerk/nextjs": "^6.5.0", "next": "15.0.3", "react": "^18", "react-dom": "^18" @@ -28,21 +28,21 @@ }, "../../arcjet-next": { "name": "@arcjet/next", - "version": "1.0.0-alpha.30", + "version": "1.0.0-alpha.31", "license": "Apache-2.0", "dependencies": { - "@arcjet/env": "1.0.0-alpha.30", - "@arcjet/headers": "1.0.0-alpha.30", - "@arcjet/ip": "1.0.0-alpha.30", - "@arcjet/logger": "1.0.0-alpha.30", - "@arcjet/protocol": "1.0.0-alpha.30", - "@arcjet/transport": "1.0.0-alpha.30", - "arcjet": "1.0.0-alpha.30" + "@arcjet/env": "1.0.0-alpha.31", + "@arcjet/headers": "1.0.0-alpha.31", + "@arcjet/ip": "1.0.0-alpha.31", + "@arcjet/logger": "1.0.0-alpha.31", + "@arcjet/protocol": "1.0.0-alpha.31", + "@arcjet/transport": "1.0.0-alpha.31", + "arcjet": "1.0.0-alpha.31" }, "devDependencies": { - "@arcjet/eslint-config": "1.0.0-alpha.30", - "@arcjet/rollup-config": "1.0.0-alpha.30", - "@arcjet/tsconfig": "1.0.0-alpha.30", + "@arcjet/eslint-config": "1.0.0-alpha.31", + "@arcjet/rollup-config": "1.0.0-alpha.31", + "@arcjet/tsconfig": "1.0.0-alpha.31", "@jest/globals": "29.7.0", "@rollup/wasm-node": "4.27.3", "@types/node": "18.18.0", @@ -74,12 +74,13 @@ "link": true }, "node_modules/@clerk/backend": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/@clerk/backend/-/backend-1.17.1.tgz", - "integrity": "sha512-gfjdLILCVdt0wOuFlv0QwYcdNR1dR7VkwhzZV8y4zhcF95AalzIQaBH3vUsOzlOxieBsuuB+dS1ZauHAwGFdgg==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/@clerk/backend/-/backend-1.18.0.tgz", + "integrity": "sha512-FIGBtr8qIgS+NbovKcLOIg8BsQj1JaykW3VKft3H83tONQD5Rg9ENXj/JX1HyZGC3ixLv5BUxu4bihQ78L/gJQ==", + "license": "MIT", "dependencies": { - "@clerk/shared": "2.16.0", - "@clerk/types": "4.34.1", + "@clerk/shared": "2.17.0", + "@clerk/types": "4.35.0", "cookie": "0.7.0", "snakecase-keys": "5.4.4", "tslib": "2.4.1" @@ -89,12 +90,13 @@ } }, "node_modules/@clerk/clerk-react": { - "version": "5.16.1", - "resolved": "https://registry.npmjs.org/@clerk/clerk-react/-/clerk-react-5.16.1.tgz", - "integrity": "sha512-CTXn4RlNLxZxrohtbmkpsZFwmE51J10ErcLXCnwNjyN0gBz0xX9fJapysGhSR3osrZASaIzmrP8/bCTnNvs7Sg==", + "version": "5.17.0", + "resolved": "https://registry.npmjs.org/@clerk/clerk-react/-/clerk-react-5.17.0.tgz", + "integrity": "sha512-++PSiayBaK877XTjbTZzyqommVlxnFNevxCKsOXbq8+KENAyYkUZ6LJpyoWjfjg1fnKq6oUFax+TwnyOyyxoqw==", + "license": "MIT", "dependencies": { - "@clerk/shared": "2.16.0", - "@clerk/types": "4.34.1", + "@clerk/shared": "2.17.0", + "@clerk/types": "4.35.0", "tslib": "2.4.1" }, "engines": { @@ -106,14 +108,15 @@ } }, "node_modules/@clerk/nextjs": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@clerk/nextjs/-/nextjs-6.4.1.tgz", - "integrity": "sha512-dmHCQMlqrdVLIKG0xO5oRsAbwjETRM5eW7wUlhTJEp3XUZYJUggR838Vupj/1sLaCJxcFWNDobgKw/MdEKT5Ng==", - "dependencies": { - "@clerk/backend": "1.17.1", - "@clerk/clerk-react": "5.16.1", - "@clerk/shared": "2.16.0", - "@clerk/types": "4.34.1", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@clerk/nextjs/-/nextjs-6.5.0.tgz", + "integrity": "sha512-0+MhX4Hz/fdvVYeZIC7XNI8qZ7vX+UtfMksE6qdyWR5IGewCsNiIHlDW0fDtau6p1e6TsQ66qTnZz15yU4G7dw==", + "license": "MIT", + "dependencies": { + "@clerk/backend": "1.18.0", + "@clerk/clerk-react": "5.17.0", + "@clerk/shared": "2.17.0", + "@clerk/types": "4.35.0", "crypto-js": "4.2.0", "ezheaders": "0.1.0", "server-only": "0.0.1", @@ -129,12 +132,13 @@ } }, "node_modules/@clerk/shared": { - "version": "2.16.0", - "resolved": "https://registry.npmjs.org/@clerk/shared/-/shared-2.16.0.tgz", - "integrity": "sha512-JM5GZcrnvppV+06v5ebsjTI5vGQFGI6TlrLiAHAfcOo/numCDR3EN5MWQW27kD09bsrRtgBNsPiejTpMqXGWjA==", + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/@clerk/shared/-/shared-2.17.0.tgz", + "integrity": "sha512-Jn/oBGjGfQQJIiMMf6Y0puC62R0rL1l/gLoPWnO6vNlCBzuFHGcsSTCWWDpmAXfyVwY7wJ7Dcq/B1UEsKeJ8zQ==", "hasInstallScript": true, + "license": "MIT", "dependencies": { - "@clerk/types": "4.34.1", + "@clerk/types": "4.35.0", "dequal": "2.0.3", "glob-to-regexp": "0.4.1", "js-cookie": "3.0.5", @@ -158,9 +162,10 @@ } }, "node_modules/@clerk/types": { - "version": "4.34.1", - "resolved": "https://registry.npmjs.org/@clerk/types/-/types-4.34.1.tgz", - "integrity": "sha512-FaeHmmoZkIrPrU6AOJ8FUke+LM8ZH072w0Aog6kbQGL3bCBZgUGFy7faTzozxbd+TWTbzVDoTAbDeZCq21UOFg==", + "version": "4.35.0", + "resolved": "https://registry.npmjs.org/@clerk/types/-/types-4.35.0.tgz", + "integrity": "sha512-sBSYCCIXcwI+JHQRqBtskw10+rQ1NcA9w1G6ndnS48F5C+if6xI9OpYaaDjhhvzLjBeZFydKAOhe35mgC7bmoA==", + "license": "MIT", "dependencies": { "csstype": "3.1.1" }, @@ -1839,6 +1844,7 @@ "version": "0.7.0", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.0.tgz", "integrity": "sha512-qCf+V4dtlNhSRXGAZatc1TasyFO6GjohcOul807YOb5ik3+kQSnb4d7iajeCL8QHaJ4uZEjCgiCJerKXwdRVlQ==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -1998,6 +2004,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "license": "MIT", "engines": { "node": ">=6" } @@ -2052,6 +2059,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "license": "MIT", "dependencies": { "no-case": "^3.0.4", "tslib": "^2.0.3" @@ -2993,7 +3001,8 @@ "node_modules/glob-to-regexp": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==" + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "license": "BSD-2-Clause" }, "node_modules/glob/node_modules/brace-expansion": { "version": "2.0.1", @@ -3685,6 +3694,7 @@ "version": "3.0.5", "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.5.tgz", "integrity": "sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==", + "license": "MIT", "engines": { "node": ">=14" } @@ -3845,6 +3855,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "license": "MIT", "dependencies": { "tslib": "^2.0.3" } @@ -3862,6 +3873,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "license": "MIT", "engines": { "node": ">=8" }, @@ -4046,6 +4058,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "license": "MIT", "dependencies": { "lower-case": "^2.0.2", "tslib": "^2.0.3" @@ -4969,6 +4982,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", + "license": "MIT", "dependencies": { "dot-case": "^3.0.4", "tslib": "^2.0.3" @@ -4978,6 +4992,7 @@ "version": "5.4.4", "resolved": "https://registry.npmjs.org/snakecase-keys/-/snakecase-keys-5.4.4.tgz", "integrity": "sha512-YTywJG93yxwHLgrYLZjlC75moVEX04LZM4FHfihjHe1FCXm+QaLOFfSf535aXOAd0ArVQMWUAe8ZPm4VtWyXaA==", + "license": "MIT", "dependencies": { "map-obj": "^4.1.0", "snake-case": "^3.0.4", @@ -4991,6 +5006,7 @@ "version": "2.19.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=12.20" }, @@ -5009,7 +5025,8 @@ "node_modules/std-env": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.8.0.tgz", - "integrity": "sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==" + "integrity": "sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==", + "license": "MIT" }, "node_modules/streamsearch": { "version": "1.1.0", @@ -5305,6 +5322,7 @@ "version": "2.2.5", "resolved": "https://registry.npmjs.org/swr/-/swr-2.2.5.tgz", "integrity": "sha512-QtxqyclFeAsxEUeZIYmsaQ0UjimSq1RZ9Un7I68/0ClKK/U3LoyQunwkQfJZr2fc22DfIXLNDc2wFyTEikCUpg==", + "license": "MIT", "dependencies": { "client-only": "^0.0.1", "use-sync-external-store": "^1.2.0" @@ -5607,6 +5625,7 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.2.tgz", "integrity": "sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw==", + "license": "MIT", "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } diff --git a/examples/nextjs-clerk-shield/package.json b/examples/nextjs-clerk-shield/package.json index a684729a4..11c95f7c8 100644 --- a/examples/nextjs-clerk-shield/package.json +++ b/examples/nextjs-clerk-shield/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@arcjet/next": "file:../../arcjet-next", - "@clerk/nextjs": "^6.4.1", + "@clerk/nextjs": "^6.5.0", "next": "15.0.3", "react": "^18", "react-dom": "^18" @@ -26,4 +26,4 @@ "tailwindcss": "^3.4.15", "typescript": "^5" } -} +} \ No newline at end of file