diff --git a/package.json b/package.json index 5e1fd8ee..2ab18c0b 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "seedrandom": "3.0.5", "superjson": "2.2.1", "supertokens-auth-react": "0.48.0", - "supertokens-node": "20.1.5", + "supertokens-node": "21.0.0", "supertokens-web-js": "0.14.0", "use-context-selector": "2.0.0", "use-immer": "0.10.0", @@ -83,7 +83,6 @@ }, "devDependencies": { "@chakra-ui/cli": "2.5.5", - "@types/cookie": "0.6.0", "@types/eslint": "9.6.1", "@types/jsonwebtoken": "9.0.7", "@types/micromatch": "4.0.9", diff --git a/src/app/api/auth/[[...path]]/route.ts b/src/app/api/auth/[[...path]]/route.ts index 24f0dbbb..35c08f6c 100644 --- a/src/app/api/auth/[[...path]]/route.ts +++ b/src/app/api/auth/[[...path]]/route.ts @@ -1,13 +1,13 @@ import type { NextRequest } from 'next/server'; -import { NextResponse } from 'next/server'; import { getAppDirRequestHandler } from 'supertokens-node/nextjs'; import { ensureSuperTokensInit } from '../../../../infrastructures/supertokens/backendConfig'; ensureSuperTokensInit(); -const handleCall = getAppDirRequestHandler(NextResponse); +const handleCall = getAppDirRequestHandler(); +// cf. https://supertokens.com/docs/emailpassword/nextjs/app-directory/setting-up-backend export async function GET(request: NextRequest): Promise { const res = await handleCall(request); if (!res.headers.has('Cache-Control')) { diff --git a/yarn.lock b/yarn.lock index 98942ad4..6d0d9b55 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3847,13 +3847,6 @@ __metadata: languageName: node linkType: hard -"@types/cookie@npm:0.6.0": - version: 0.6.0 - resolution: "@types/cookie@npm:0.6.0" - checksum: 10c0/5b326bd0188120fb32c0be086b141b1481fec9941b76ad537f9110e10d61ee2636beac145463319c71e4be67a17e85b81ca9e13ceb6e3bb63b93d16824d6c149 - languageName: node - linkType: hard - "@types/eslint@npm:9.6.1": version: 9.6.1 resolution: "@types/eslint@npm:9.6.1" @@ -5994,10 +5987,10 @@ __metadata: languageName: node linkType: hard -"cookie@npm:0.4.0": - version: 0.4.0 - resolution: "cookie@npm:0.4.0" - checksum: 10c0/71508a1c8a4e97bb88f42635542ef24ebe7e713f82573ac61e9b289616334d14bfb28210d7979d9ada24b0254f5fb563af938cac13bc8c0c3f60f47a2257f791 +"cookie@npm:^0.7.2": + version: 0.7.2 + resolution: "cookie@npm:0.7.2" + checksum: 10c0/9596e8ccdbf1a3a88ae02cf5ee80c1c50959423e1022e4e60b91dd87c622af1da309253d8abdb258fb5e3eacb4f08e579dc58b4897b8087574eee0fd35dfa5d2 languageName: node linkType: hard @@ -13145,6 +13138,13 @@ __metadata: languageName: node linkType: hard +"set-cookie-parser@npm:^2.6.0": + version: 2.7.1 + resolution: "set-cookie-parser@npm:2.7.1" + checksum: 10c0/060c198c4c92547ac15988256f445eae523f57f2ceefeccf52d30d75dedf6bff22b9c26f756bd44e8e560d44ff4ab2130b178bd2e52ef5571bf7be3bd7632d9a + languageName: node + linkType: hard + "set-function-length@npm:^1.2.1": version: 1.2.2 resolution: "set-function-length@npm:1.2.2" @@ -13928,13 +13928,13 @@ __metadata: languageName: node linkType: hard -"supertokens-node@npm:20.1.5": - version: 20.1.5 - resolution: "supertokens-node@npm:20.1.5" +"supertokens-node@npm:21.0.0": + version: 21.0.0 + resolution: "supertokens-node@npm:21.0.0" dependencies: buffer: "npm:^6.0.3" content-type: "npm:^1.0.5" - cookie: "npm:0.4.0" + cookie: "npm:^0.7.2" cross-fetch: "npm:^3.1.6" debug: "npm:^4.3.3" jose: "npm:^4.13.1" @@ -13943,10 +13943,11 @@ __metadata: pako: "npm:^2.1.0" pkce-challenge: "npm:^3.0.0" process: "npm:^0.11.10" + set-cookie-parser: "npm:^2.6.0" supertokens-js-override: "npm:^0.0.4" tldts: "npm:^6.1.48" twilio: "npm:^4.19.3" - checksum: 10c0/6e8c223a2e084770b070288440adb0547da581e9412f0671f6d99d6e7ffb11148d653a2c90c4477f104f2204d4d4c82e5a57701ee271bccf5cc91918f668d7cf + checksum: 10c0/aee89761b39740a3b48b9a2b2bd5a4c6ea64823f1d9720b7db5182fa79d7ec2b3030929faacb8e641d1613c24bbfb0589411c1c7e16b75757b39dfc56afd7c79 languageName: node linkType: hard @@ -14266,7 +14267,6 @@ __metadata: "@trpc/next": "npm:11.0.0-rc.608" "@trpc/react-query": "npm:11.0.0-rc.608" "@trpc/server": "npm:11.0.0-rc.608" - "@types/cookie": "npm:0.6.0" "@types/eslint": "npm:9.6.1" "@types/jsonwebtoken": "npm:9.0.7" "@types/micromatch": "npm:4.0.9" @@ -14327,7 +14327,7 @@ __metadata: sort-package-json: "npm:2.10.1" superjson: "npm:2.2.1" supertokens-auth-react: "npm:0.48.0" - supertokens-node: "npm:20.1.5" + supertokens-node: "npm:21.0.0" supertokens-web-js: "npm:0.14.0" typescript: "npm:5.6.3" use-context-selector: "npm:2.0.0"