From a0ca064e3204832285cb135b8be5a0c6d8453eab Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Wed, 12 Oct 2022 11:27:31 -0400 Subject: [PATCH 1/6] chore: upgrade next-auth to latest --- demos/next-auth/package.json | 4 +-- package-lock.json | 51 ++++++++++++++++++------------------ 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/demos/next-auth/package.json b/demos/next-auth/package.json index 5352f977c4..89c038d3d3 100644 --- a/demos/next-auth/package.json +++ b/demos/next-auth/package.json @@ -24,7 +24,7 @@ "license": "MIT", "dependencies": { "next": "^12.3.0", - "next-auth": "^4.7.0", + "next-auth": "^4.13.0", "nodemailer": "^6.6.3", "react": "^18.0.0", "react-dom": "^18.0.0" @@ -45,4 +45,4 @@ "engines": { "node": ">=16.0.0" } -} \ No newline at end of file +} diff --git a/package-lock.json b/package-lock.json index 8b82e4af09..70cf375cde 100644 --- a/package-lock.json +++ b/package-lock.json @@ -213,7 +213,7 @@ "license": "MIT", "dependencies": { "next": "^12.3.0", - "next-auth": "^4.7.0", + "next-auth": "^4.13.0", "nodemailer": "^6.6.3", "react": "^18.0.0", "react-dom": "^18.0.0" @@ -8392,9 +8392,9 @@ } }, "node_modules/cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", "engines": { "node": ">= 0.6" } @@ -15009,9 +15009,9 @@ } }, "node_modules/jose": { - "version": "4.8.3", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.8.3.tgz", - "integrity": "sha512-7rySkpW78d8LBp4YU70Wb7+OTgE3OwAALNVZxhoIhp4Kscp+p/fBkdpxGAMKxvCAMV4QfXBU9m6l9nX/vGwd2g==", + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.10.0.tgz", + "integrity": "sha512-KEhB/eLGLomWGPTb+/RNbYsTjIyx03JmbqAyIyiXBuNSa7CmNrJd5ysFhblayzs/e/vbOPMUaLnjHUMhGp4yLw==", "funding": { "url": "https://github.com/sponsors/panva" } @@ -17272,14 +17272,14 @@ } }, "node_modules/next-auth": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/next-auth/-/next-auth-4.10.3.tgz", - "integrity": "sha512-7zc4aXYc/EEln7Pkcsn21V1IevaTZsMLJwapfbnKA4+JY0+jFzWbt5p/ljugesGIrN4VOZhpZIw50EaFZyghJQ==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/next-auth/-/next-auth-4.13.0.tgz", + "integrity": "sha512-FtkPpeb9Bax6yKDaxcaGIvZZjvr10JaU2AsBYv1yv4N6rP86Xa7/4Ro1Aq94YGwsYzk+YKS52CRjD2DqCcSmVA==", "dependencies": { "@babel/runtime": "^7.16.3", "@panva/hkdf": "^1.0.1", - "cookie": "^0.4.1", - "jose": "^4.3.7", + "cookie": "^0.5.0", + "jose": "^4.9.3", "oauth": "^0.9.15", "openid-client": "^5.1.0", "preact": "^10.6.3", @@ -17290,6 +17290,7 @@ "node": "^12.19.0 || ^14.15.0 || ^16.13.0" }, "peerDependencies": { + "next": "^12.2.5", "nodemailer": "^6.6.5", "react": "^17.0.2 || ^18", "react-dom": "^17.0.2 || ^18" @@ -23348,7 +23349,7 @@ }, "packages/runtime": { "name": "@netlify/plugin-nextjs", - "version": "4.24.3", + "version": "4.25.0", "license": "MIT", "dependencies": { "@netlify/esbuild": "0.14.39", @@ -29255,9 +29256,9 @@ } }, "cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==" + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==" }, "cookies": { "version": "0.8.0", @@ -34290,9 +34291,9 @@ } }, "jose": { - "version": "4.8.3", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.8.3.tgz", - "integrity": "sha512-7rySkpW78d8LBp4YU70Wb7+OTgE3OwAALNVZxhoIhp4Kscp+p/fBkdpxGAMKxvCAMV4QfXBU9m6l9nX/vGwd2g==" + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.10.0.tgz", + "integrity": "sha512-KEhB/eLGLomWGPTb+/RNbYsTjIyx03JmbqAyIyiXBuNSa7CmNrJd5ysFhblayzs/e/vbOPMUaLnjHUMhGp4yLw==" }, "js-tokens": { "version": "4.0.0", @@ -36082,14 +36083,14 @@ } }, "next-auth": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/next-auth/-/next-auth-4.10.3.tgz", - "integrity": "sha512-7zc4aXYc/EEln7Pkcsn21V1IevaTZsMLJwapfbnKA4+JY0+jFzWbt5p/ljugesGIrN4VOZhpZIw50EaFZyghJQ==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/next-auth/-/next-auth-4.13.0.tgz", + "integrity": "sha512-FtkPpeb9Bax6yKDaxcaGIvZZjvr10JaU2AsBYv1yv4N6rP86Xa7/4Ro1Aq94YGwsYzk+YKS52CRjD2DqCcSmVA==", "requires": { "@babel/runtime": "^7.16.3", "@panva/hkdf": "^1.0.1", - "cookie": "^0.4.1", - "jose": "^4.3.7", + "cookie": "^0.5.0", + "jose": "^4.9.3", "oauth": "^0.9.15", "openid-client": "^5.1.0", "preact": "^10.6.3", @@ -36107,7 +36108,7 @@ "@types/react": "^18.0.0", "husky": "^7.0.4", "next": "^12.3.0", - "next-auth": "^4.7.0", + "next-auth": "^4.13.0", "nodemailer": "^6.6.3", "npm-run-all": "^4.1.5", "react": "^18.0.0", From 70f290c0958eaa580e25a91c5a72273050e2b91f Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Mon, 24 Oct 2022 14:26:58 -0400 Subject: [PATCH 2/6] chore: upgrade next-auth again --- demos/next-auth/package.json | 2 +- package-lock.json | 488 +---------------------------------- 2 files changed, 14 insertions(+), 476 deletions(-) diff --git a/demos/next-auth/package.json b/demos/next-auth/package.json index 89c038d3d3..f129db0f0f 100644 --- a/demos/next-auth/package.json +++ b/demos/next-auth/package.json @@ -24,7 +24,7 @@ "license": "MIT", "dependencies": { "next": "^12.3.0", - "next-auth": "^4.13.0", + "next-auth": "^4.15.0", "nodemailer": "^6.6.3", "react": "^18.0.0", "react-dom": "^18.0.0" diff --git a/package-lock.json b/package-lock.json index 3188448a85..68009e86f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -213,7 +213,7 @@ "license": "MIT", "dependencies": { "next": "^12.3.0", - "next-auth": "^4.13.0", + "next-auth": "^4.15.0", "nodemailer": "^6.6.3", "react": "^18.0.0", "react-dom": "^18.0.0" @@ -319,6 +319,7 @@ }, "demos/server-components": { "version": "1.0.0", + "extraneous": true, "license": "MIT", "dependencies": { "ms": "2.1.3", @@ -336,310 +337,6 @@ "typescript": "^4.6.3" } }, - "demos/server-components/node_modules/@next/env": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/env/-/env-12.2.1.tgz", - "integrity": "sha512-lz3TJKIvbdGRUsUr/+h3vy7XvBNGTGzHwhurk5AtqrABj4Zyo70xbshcI7YQTNUK4x9OA/E+SOcXvVx0DHmFRw==" - }, - "demos/server-components/node_modules/@next/swc-android-arm-eabi": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.2.1.tgz", - "integrity": "sha512-Gk7fvo1McA9gues9hixoeoxKnvvUusW0P+fya4ZAU3us+bQm1EqSoDrnOrUsdsgwIPQ3HobOJPY5C3xvKOl/tA==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - "demos/server-components/node_modules/@next/swc-android-arm64": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-12.2.1.tgz", - "integrity": "sha512-J+QwWRm2+bOtacZFahoplX3dCYGDpou86VjfcE+M5/E0UCtBmZ6JvItyV4scK8wSKHQQUWq8DmOEm/C0lhsSRQ==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - "demos/server-components/node_modules/@next/swc-darwin-arm64": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.2.1.tgz", - "integrity": "sha512-teSfpKHdHQER4FVVCdvS0fHff35Gh4LB2DZ2eNAateIluP2Gnl+tT881MeM4Knvl2Mvm3Z3vtSJNthVoveJnMA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "demos/server-components/node_modules/@next/swc-darwin-x64": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-12.2.1.tgz", - "integrity": "sha512-flA1H+9krrINtdWoXBzeESkdIV34OKX0+Lnqd90J1nsERTXntYy6CNOMxMtv1otAcnFy7EHYJQIL8URuu/2XXg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "demos/server-components/node_modules/@next/swc-freebsd-x64": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.2.1.tgz", - "integrity": "sha512-SkAjp7B7aBxAsRVMZGiAp/qMkh65PLzYuLBTsBSu+4fxFuKF7MAEgaIUhvC8zzD58A+Y9yrY/3813bhtrwkcuA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 10" - } - }, - "demos/server-components/node_modules/@next/swc-linux-arm-gnueabihf": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.2.1.tgz", - "integrity": "sha512-V7ov2LXrLWuYVH/syzrzpmwWumg5rCh0siwOPNCRzVkrpgP8WoIRNdeZ/NQIj0ng+kq7gDF1jib583Lk0wbDeQ==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "demos/server-components/node_modules/@next/swc-linux-arm64-gnu": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.2.1.tgz", - "integrity": "sha512-HlnDQD3r4YqCj2gu6uo86oEM0ixBsyKLaPcZcGwWAD5mFG5R4zzTZG7BO2wJkGWmkzijHluE14dlTmfzc8jdEQ==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "demos/server-components/node_modules/@next/swc-linux-arm64-musl": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.2.1.tgz", - "integrity": "sha512-P8AkWd4RHbuF24ol3jk2akXpntcDI0gv5uD7eMpAOXb8W2A6y/sv0tKNSGUV3efSutOyu23jNn2EiTNxHgU4NQ==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "demos/server-components/node_modules/@next/swc-linux-x64-gnu": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.2.1.tgz", - "integrity": "sha512-ZbsM+rIMqK6xi3lovspzPJoIPre3LglKrCXKLkln7rD0uiymzfLhS2VCj8u4qRynz22iAzuI4mJNpZa3AsJFrA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "demos/server-components/node_modules/@next/swc-linux-x64-musl": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.2.1.tgz", - "integrity": "sha512-JeATguMe37bviPwkIUjO7T3kcefMBQwJFLhkFTaJYGmPm12EsW1FtKcg87AI87xdGvfrHQKlM3phNaG/dkneTQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "demos/server-components/node_modules/@next/swc-win32-arm64-msvc": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.2.1.tgz", - "integrity": "sha512-8dal/MdrVshDKYBtloJw/RhJx140KUoRRYoRfpJ9oAdP8UXBdR0haKfg5EdOy98t8Q76apArxPsK7DfwoR1f3w==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "demos/server-components/node_modules/@next/swc-win32-ia32-msvc": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.2.1.tgz", - "integrity": "sha512-uSAoOBpCp4oxVD9gTY1f27hr9xNLEOCglxZPH1+FonHpM5n9Sp4H01uQHWE/Y26iHmJeUJAWxtRxEYylnO4U9A==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "demos/server-components/node_modules/@next/swc-win32-x64-msvc": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.2.1.tgz", - "integrity": "sha512-gx4aLMAZAVjtShiCrUSszoxnzBWJWf09Lkey6mcc0jFZjbz4xkyDbp53V229DtOYTUL4t0IZJ0I7+ftQ5CYIjg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "demos/server-components/node_modules/@swc/helpers": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.2.tgz", - "integrity": "sha512-556Az0VX7WR6UdoTn4htt/l3zPQ7bsQWK+HqdG4swV7beUCxo/BqmvbOpUkTIm/9ih86LIf1qsUnywNL3obGHw==", - "dependencies": { - "tslib": "^2.4.0" - } - }, - "demos/server-components/node_modules/next": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/next/-/next-12.2.1.tgz", - "integrity": "sha512-090KB5CZRlLG/GWxb8tA1ZFwqL8OfpUtH4mXA7POuisa6NL5ihiAZhfk5nRBdPHvkXuSt0n7zQaVym6SrT3Wiw==", - "dependencies": { - "@next/env": "12.2.1", - "@swc/helpers": "0.4.2", - "caniuse-lite": "^1.0.30001332", - "postcss": "8.4.5", - "styled-jsx": "5.0.2", - "use-sync-external-store": "1.1.0" - }, - "bin": { - "next": "dist/bin/next" - }, - "engines": { - "node": ">=12.22.0" - }, - "optionalDependencies": { - "@next/swc-android-arm-eabi": "12.2.1", - "@next/swc-android-arm64": "12.2.1", - "@next/swc-darwin-arm64": "12.2.1", - "@next/swc-darwin-x64": "12.2.1", - "@next/swc-freebsd-x64": "12.2.1", - "@next/swc-linux-arm-gnueabihf": "12.2.1", - "@next/swc-linux-arm64-gnu": "12.2.1", - "@next/swc-linux-arm64-musl": "12.2.1", - "@next/swc-linux-x64-gnu": "12.2.1", - "@next/swc-linux-x64-musl": "12.2.1", - "@next/swc-win32-arm64-msvc": "12.2.1", - "@next/swc-win32-ia32-msvc": "12.2.1", - "@next/swc-win32-x64-msvc": "12.2.1" - }, - "peerDependencies": { - "fibers": ">= 3.1.0", - "node-sass": "^6.0.0 || ^7.0.0", - "react": "^17.0.2 || ^18.0.0-0", - "react-dom": "^17.0.2 || ^18.0.0-0", - "sass": "^1.3.0" - }, - "peerDependenciesMeta": { - "fibers": { - "optional": true - }, - "node-sass": { - "optional": true - }, - "sass": { - "optional": true - } - } - }, - "demos/server-components/node_modules/postcss": { - "version": "8.4.5", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.5.tgz", - "integrity": "sha512-jBDboWM8qpaqwkMwItqTQTiFikhs/67OYVvblFFTM7MrZjt6yMKd6r2kgXizEbTTljacm4NldIlZnhbjr84QYg==", - "dependencies": { - "nanoid": "^3.1.30", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - } - }, - "demos/server-components/node_modules/styled-jsx": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.0.2.tgz", - "integrity": "sha512-LqPQrbBh3egD57NBcHET4qcgshPks+yblyhPlH2GY8oaDgKs8SK4C3dBh3oSJjgzJ3G5t1SYEZGHkP+QEpX9EQ==", - "engines": { - "node": ">= 12.0.0" - }, - "peerDependencies": { - "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0" - }, - "peerDependenciesMeta": { - "@babel/core": { - "optional": true - }, - "babel-plugin-macros": { - "optional": true - } - } - }, - "demos/server-components/node_modules/use-sync-external-store": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.1.0.tgz", - "integrity": "sha512-SEnieB2FPKEVne66NpXPd1Np4R1lTNKfjuy3XdIoPQKYBAFdzbzSZlSn1KJZUiihQLQC5Znot4SBz1EOTBwQAQ==", - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" - } - }, "demos/static-root": { "name": "static-root-demo", "version": "1.0.0", @@ -17028,7 +16725,8 @@ "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true }, "node_modules/murmurhash": { "version": "2.0.0", @@ -17276,9 +16974,9 @@ } }, "node_modules/next-auth": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/next-auth/-/next-auth-4.13.0.tgz", - "integrity": "sha512-FtkPpeb9Bax6yKDaxcaGIvZZjvr10JaU2AsBYv1yv4N6rP86Xa7/4Ro1Aq94YGwsYzk+YKS52CRjD2DqCcSmVA==", + "version": "4.15.0", + "resolved": "https://registry.npmjs.org/next-auth/-/next-auth-4.15.0.tgz", + "integrity": "sha512-IasNzGLM2VlmyioDdZaRwBBBm8b5xo+zbbqVWHFh0bY6iQUZ3vuudrsdHNdxkXV3LSHdKNaoWEpYr4BydB7mCw==", "dependencies": { "@babel/runtime": "^7.16.3", "@panva/hkdf": "^1.0.1", @@ -20462,10 +20160,6 @@ "node": ">= 0.6" } }, - "node_modules/server-components": { - "resolved": "demos/server-components", - "link": true - }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -35910,7 +35604,8 @@ "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true }, "murmurhash": { "version": "2.0.0", @@ -36095,9 +35790,9 @@ } }, "next-auth": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/next-auth/-/next-auth-4.13.0.tgz", - "integrity": "sha512-FtkPpeb9Bax6yKDaxcaGIvZZjvr10JaU2AsBYv1yv4N6rP86Xa7/4Ro1Aq94YGwsYzk+YKS52CRjD2DqCcSmVA==", + "version": "4.15.0", + "resolved": "https://registry.npmjs.org/next-auth/-/next-auth-4.15.0.tgz", + "integrity": "sha512-IasNzGLM2VlmyioDdZaRwBBBm8b5xo+zbbqVWHFh0bY6iQUZ3vuudrsdHNdxkXV3LSHdKNaoWEpYr4BydB7mCw==", "requires": { "@babel/runtime": "^7.16.3", "@panva/hkdf": "^1.0.1", @@ -36120,7 +35815,7 @@ "@types/react": "^18.0.0", "husky": "^7.0.4", "next": "^12.3.0", - "next-auth": "^4.13.0", + "next-auth": "^4.15.0", "nodemailer": "^6.6.3", "npm-run-all": "^4.1.5", "react": "^18.0.0", @@ -38526,163 +38221,6 @@ } } }, - "server-components": { - "version": "file:demos/server-components", - "requires": { - "@netlify/plugin-nextjs": "*", - "@types/fs-extra": "^9.0.13", - "@types/jest": "^27.4.1", - "@types/node": "^17.0.25", - "husky": "^7.0.4", - "ms": "2.1.3", - "next": "12.2.1", - "npm-run-all": "^4.1.5", - "react": "^18.0.0", - "react-dom": "^18.0.0", - "typescript": "^4.6.3" - }, - "dependencies": { - "@next/env": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/env/-/env-12.2.1.tgz", - "integrity": "sha512-lz3TJKIvbdGRUsUr/+h3vy7XvBNGTGzHwhurk5AtqrABj4Zyo70xbshcI7YQTNUK4x9OA/E+SOcXvVx0DHmFRw==" - }, - "@next/swc-android-arm-eabi": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.2.1.tgz", - "integrity": "sha512-Gk7fvo1McA9gues9hixoeoxKnvvUusW0P+fya4ZAU3us+bQm1EqSoDrnOrUsdsgwIPQ3HobOJPY5C3xvKOl/tA==", - "optional": true - }, - "@next/swc-android-arm64": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-12.2.1.tgz", - "integrity": "sha512-J+QwWRm2+bOtacZFahoplX3dCYGDpou86VjfcE+M5/E0UCtBmZ6JvItyV4scK8wSKHQQUWq8DmOEm/C0lhsSRQ==", - "optional": true - }, - "@next/swc-darwin-arm64": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.2.1.tgz", - "integrity": "sha512-teSfpKHdHQER4FVVCdvS0fHff35Gh4LB2DZ2eNAateIluP2Gnl+tT881MeM4Knvl2Mvm3Z3vtSJNthVoveJnMA==", - "optional": true - }, - "@next/swc-darwin-x64": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-12.2.1.tgz", - "integrity": "sha512-flA1H+9krrINtdWoXBzeESkdIV34OKX0+Lnqd90J1nsERTXntYy6CNOMxMtv1otAcnFy7EHYJQIL8URuu/2XXg==", - "optional": true - }, - "@next/swc-freebsd-x64": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.2.1.tgz", - "integrity": "sha512-SkAjp7B7aBxAsRVMZGiAp/qMkh65PLzYuLBTsBSu+4fxFuKF7MAEgaIUhvC8zzD58A+Y9yrY/3813bhtrwkcuA==", - "optional": true - }, - "@next/swc-linux-arm-gnueabihf": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.2.1.tgz", - "integrity": "sha512-V7ov2LXrLWuYVH/syzrzpmwWumg5rCh0siwOPNCRzVkrpgP8WoIRNdeZ/NQIj0ng+kq7gDF1jib583Lk0wbDeQ==", - "optional": true - }, - "@next/swc-linux-arm64-gnu": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.2.1.tgz", - "integrity": "sha512-HlnDQD3r4YqCj2gu6uo86oEM0ixBsyKLaPcZcGwWAD5mFG5R4zzTZG7BO2wJkGWmkzijHluE14dlTmfzc8jdEQ==", - "optional": true - }, - "@next/swc-linux-arm64-musl": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.2.1.tgz", - "integrity": "sha512-P8AkWd4RHbuF24ol3jk2akXpntcDI0gv5uD7eMpAOXb8W2A6y/sv0tKNSGUV3efSutOyu23jNn2EiTNxHgU4NQ==", - "optional": true - }, - "@next/swc-linux-x64-gnu": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.2.1.tgz", - "integrity": "sha512-ZbsM+rIMqK6xi3lovspzPJoIPre3LglKrCXKLkln7rD0uiymzfLhS2VCj8u4qRynz22iAzuI4mJNpZa3AsJFrA==", - "optional": true - }, - "@next/swc-linux-x64-musl": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.2.1.tgz", - "integrity": "sha512-JeATguMe37bviPwkIUjO7T3kcefMBQwJFLhkFTaJYGmPm12EsW1FtKcg87AI87xdGvfrHQKlM3phNaG/dkneTQ==", - "optional": true - }, - "@next/swc-win32-arm64-msvc": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.2.1.tgz", - "integrity": "sha512-8dal/MdrVshDKYBtloJw/RhJx140KUoRRYoRfpJ9oAdP8UXBdR0haKfg5EdOy98t8Q76apArxPsK7DfwoR1f3w==", - "optional": true - }, - "@next/swc-win32-ia32-msvc": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.2.1.tgz", - "integrity": "sha512-uSAoOBpCp4oxVD9gTY1f27hr9xNLEOCglxZPH1+FonHpM5n9Sp4H01uQHWE/Y26iHmJeUJAWxtRxEYylnO4U9A==", - "optional": true - }, - "@next/swc-win32-x64-msvc": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.2.1.tgz", - "integrity": "sha512-gx4aLMAZAVjtShiCrUSszoxnzBWJWf09Lkey6mcc0jFZjbz4xkyDbp53V229DtOYTUL4t0IZJ0I7+ftQ5CYIjg==", - "optional": true - }, - "@swc/helpers": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.2.tgz", - "integrity": "sha512-556Az0VX7WR6UdoTn4htt/l3zPQ7bsQWK+HqdG4swV7beUCxo/BqmvbOpUkTIm/9ih86LIf1qsUnywNL3obGHw==", - "requires": { - "tslib": "^2.4.0" - } - }, - "next": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/next/-/next-12.2.1.tgz", - "integrity": "sha512-090KB5CZRlLG/GWxb8tA1ZFwqL8OfpUtH4mXA7POuisa6NL5ihiAZhfk5nRBdPHvkXuSt0n7zQaVym6SrT3Wiw==", - "requires": { - "@next/env": "12.2.1", - "@next/swc-android-arm-eabi": "12.2.1", - "@next/swc-android-arm64": "12.2.1", - "@next/swc-darwin-arm64": "12.2.1", - "@next/swc-darwin-x64": "12.2.1", - "@next/swc-freebsd-x64": "12.2.1", - "@next/swc-linux-arm-gnueabihf": "12.2.1", - "@next/swc-linux-arm64-gnu": "12.2.1", - "@next/swc-linux-arm64-musl": "12.2.1", - "@next/swc-linux-x64-gnu": "12.2.1", - "@next/swc-linux-x64-musl": "12.2.1", - "@next/swc-win32-arm64-msvc": "12.2.1", - "@next/swc-win32-ia32-msvc": "12.2.1", - "@next/swc-win32-x64-msvc": "12.2.1", - "@swc/helpers": "0.4.2", - "caniuse-lite": "^1.0.30001332", - "postcss": "8.4.5", - "styled-jsx": "5.0.2", - "use-sync-external-store": "1.1.0" - } - }, - "postcss": { - "version": "8.4.5", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.5.tgz", - "integrity": "sha512-jBDboWM8qpaqwkMwItqTQTiFikhs/67OYVvblFFTM7MrZjt6yMKd6r2kgXizEbTTljacm4NldIlZnhbjr84QYg==", - "requires": { - "nanoid": "^3.1.30", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.1" - } - }, - "styled-jsx": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.0.2.tgz", - "integrity": "sha512-LqPQrbBh3egD57NBcHET4qcgshPks+yblyhPlH2GY8oaDgKs8SK4C3dBh3oSJjgzJ3G5t1SYEZGHkP+QEpX9EQ==", - "requires": {} - }, - "use-sync-external-store": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.1.0.tgz", - "integrity": "sha512-SEnieB2FPKEVne66NpXPd1Np4R1lTNKfjuy3XdIoPQKYBAFdzbzSZlSn1KJZUiihQLQC5Znot4SBz1EOTBwQAQ==", - "requires": {} - } - } - }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", From d5d0d8bf43cc55325a75ceca01d0b70ebc36365b Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Mon, 24 Oct 2022 15:16:59 -0400 Subject: [PATCH 3/6] fix: change how the base nextAuthUrl is created --- packages/runtime/src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/runtime/src/index.ts b/packages/runtime/src/index.ts index 37f67f6aa4..1ec45ce275 100644 --- a/packages/runtime/src/index.ts +++ b/packages/runtime/src/index.ts @@ -136,7 +136,9 @@ const plugin: NetlifyPlugin = { await updateRequiredServerFiles(publish, config) } else { - const nextAuthUrl = `${process.env.DEPLOY_PRIME_URL}${basePath}` + // Using the deploy prime url in production leads to issues because the unique deploy ID is part of the generated URL + // and will not match the expected URL in the callback URL of an OAuth application. + const nextAuthUrl = process.env.CONTEXT === 'production' ? `${process.env.URL}${basePath}` : `${process.env.DEPLOY_PRIME_URL}${basePath}` console.log(`NextAuth package detected, setting NEXTAUTH_URL environment variable to ${nextAuthUrl}`) config.config.env.NEXTAUTH_URL = nextAuthUrl From b416d1bb4a305dae6c794ab7d23da54b19cccd07 Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Mon, 24 Oct 2022 15:18:09 -0400 Subject: [PATCH 4/6] style: lint --- packages/runtime/src/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/runtime/src/index.ts b/packages/runtime/src/index.ts index 1ec45ce275..f11c188f97 100644 --- a/packages/runtime/src/index.ts +++ b/packages/runtime/src/index.ts @@ -138,7 +138,10 @@ const plugin: NetlifyPlugin = { } else { // Using the deploy prime url in production leads to issues because the unique deploy ID is part of the generated URL // and will not match the expected URL in the callback URL of an OAuth application. - const nextAuthUrl = process.env.CONTEXT === 'production' ? `${process.env.URL}${basePath}` : `${process.env.DEPLOY_PRIME_URL}${basePath}` + const nextAuthUrl = + process.env.CONTEXT === 'production' + ? `${process.env.URL}${basePath}` + : `${process.env.DEPLOY_PRIME_URL}${basePath}` console.log(`NextAuth package detected, setting NEXTAUTH_URL environment variable to ${nextAuthUrl}`) config.config.env.NEXTAUTH_URL = nextAuthUrl From 4ba1a59da20ace2ddc4f4daac53d4264c8a624d4 Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Mon, 24 Oct 2022 16:01:41 -0400 Subject: [PATCH 5/6] test: add test coverage for the next-auth url logic --- test/index.js | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/test/index.js b/test/index.js index 1a94c77fe6..7a73d0dd2c 100644 --- a/test/index.js +++ b/test/index.js @@ -232,6 +232,8 @@ describe('onBuild()', () => { afterEach(() => { delete process.env.DEPLOY_PRIME_URL + delete process.env.URL + delete process.env.CONTEXT }) test('does not set NEXTAUTH_URL if value is already set', async () => { @@ -253,6 +255,53 @@ describe('onBuild()', () => { expect(config.config.env.NEXTAUTH_URL).toEqual(mockUserDefinedSiteUrl) }) + test('sets the NEXTAUTH_URL to the DEPLOY_PRIME_URL when CONTEXT env variable is not \'production\'', async () => { + const mockUserDefinedSiteUrl = chance.url() + process.env.DEPLOY_PRIME_URL = mockUserDefinedSiteUrl + process.env.URL = chance.url() + + // See https://docs.netlify.com/configure-builds/environment-variables/#build-metadata for all possible values + process.env.CONTEXT = 'deploy-preview' + + await moveNextDist() + + const initialConfig = await getRequiredServerFiles(netlifyConfig.build.publish) + + initialConfig.config.env.NEXTAUTH_URL = mockUserDefinedSiteUrl + await updateRequiredServerFiles(netlifyConfig.build.publish, initialConfig) + + await nextRuntime.onBuild(defaultArgs) + + expect(onBuildHasRun(netlifyConfig)).toBe(true) + const config = await getRequiredServerFiles(netlifyConfig.build.publish) + + expect(config.config.env.NEXTAUTH_URL).toEqual(mockUserDefinedSiteUrl) + }) + + test('sets the NEXTAUTH_URL to the URL when CONTEXT env variable is \'production\'', async () => { + const mockUserDefinedSiteUrl = chance.url() + process.env.DEPLOY_PRIME_URL = chance.url() + process.env.URL = mockUserDefinedSiteUrl + + // See https://docs.netlify.com/configure-builds/environment-variables/#build-metadata for all possible values + process.env.CONTEXT = 'production' + + await moveNextDist() + + const initialConfig = await getRequiredServerFiles(netlifyConfig.build.publish) + + initialConfig.config.env.NEXTAUTH_URL = mockUserDefinedSiteUrl + await updateRequiredServerFiles(netlifyConfig.build.publish, initialConfig) + + await nextRuntime.onBuild(defaultArgs) + + expect(onBuildHasRun(netlifyConfig)).toBe(true) + const config = await getRequiredServerFiles(netlifyConfig.build.publish) + + expect(config.config.env.NEXTAUTH_URL).toEqual(mockUserDefinedSiteUrl) + }) + + test('sets the NEXTAUTH_URL specified in the netlify.toml or in the Netlify UI', async () => { const mockSiteUrl = chance.url() process.env.NEXTAUTH_URL = mockSiteUrl From e4e0170f78cb425ce42c7800a272e5180c936a63 Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Tue, 25 Oct 2022 08:58:06 -0400 Subject: [PATCH 6/6] Apply suggestions from code review Co-authored-by: Nick Taylor --- packages/runtime/src/index.ts | 7 +++---- test/index.js | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/runtime/src/index.ts b/packages/runtime/src/index.ts index f11c188f97..33723b3760 100644 --- a/packages/runtime/src/index.ts +++ b/packages/runtime/src/index.ts @@ -138,10 +138,9 @@ const plugin: NetlifyPlugin = { } else { // Using the deploy prime url in production leads to issues because the unique deploy ID is part of the generated URL // and will not match the expected URL in the callback URL of an OAuth application. - const nextAuthUrl = - process.env.CONTEXT === 'production' - ? `${process.env.URL}${basePath}` - : `${process.env.DEPLOY_PRIME_URL}${basePath}` + const nextAuthUrl = `${ + process.env.CONTEXT === 'production' ? process.env.URL : process.env.DEPLOY_PRIME_URL + }${basePath}` console.log(`NextAuth package detected, setting NEXTAUTH_URL environment variable to ${nextAuthUrl}`) config.config.env.NEXTAUTH_URL = nextAuthUrl diff --git a/test/index.js b/test/index.js index 7a73d0dd2c..d79d8b4815 100644 --- a/test/index.js +++ b/test/index.js @@ -278,7 +278,7 @@ describe('onBuild()', () => { expect(config.config.env.NEXTAUTH_URL).toEqual(mockUserDefinedSiteUrl) }) - test('sets the NEXTAUTH_URL to the URL when CONTEXT env variable is \'production\'', async () => { + test('sets the NEXTAUTH_URL to the user defined site URL when CONTEXT env variable is \'production\'', async () => { const mockUserDefinedSiteUrl = chance.url() process.env.DEPLOY_PRIME_URL = chance.url() process.env.URL = mockUserDefinedSiteUrl