fix: Add support for Node 18 (#5656)

* add support for Node 18

* update node engines in packages/next-auth

Co-authored-by: Thang Vu <hi@thvu.dev>
This commit is contained in:
Nico Miebach
2022-10-31 07:54:16 +01:00
committed by GitHub
parent 777da4302d
commit 30ad639d16
8 changed files with 11 additions and 11 deletions

View File

@@ -4,5 +4,5 @@ outputs:
version:
description: "npm package version"
runs:
using: "node16"
using: "node18"
main: "index.js"

View File

@@ -25,7 +25,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "pnpm"
- name: Install dependencies
run: pnpm install
@@ -59,7 +59,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "pnpm"
- name: Install dependencies
run: pnpm install
@@ -89,7 +89,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "pnpm"
- name: Install dependencies
run: pnpm install

2
.nvmrc
View File

@@ -1 +1 @@
16
18

View File

@@ -41,7 +41,7 @@ corepack enable pnpm
(Now, if you run `pnpm --version`, it should print the same verion as the `packageManager` property in the [`package.json` file](https://github.com/nextauthjs/next-auth/blob/main/package.json))
3. Install packages. Developing requires Node.js v16:
3. Install packages. Developing requires Node.js v18:
```sh
pnpm install

View File

@@ -3,7 +3,7 @@ id: corporate-proxy
title: Add support for HTTP Proxy
--
Using NextAuth.js behind a corporate proxy is not supported out of the box. This is due to the fact that the underlying library we use, [`openid-client`](https://npm.im/openid-client), uses the built-in Node.js `http` / `https` libraries, which do not support proxys by default. (See: [`http` docs](https://nodejs.org/dist/latest-v16.x/docs/api/http.html), [`https` docs](https://nodejs.org/dist/latest-v16.x/docs/api/https.html)).
Using NextAuth.js behind a corporate proxy is not supported out of the box. This is due to the fact that the underlying library we use, [`openid-client`](https://npm.im/openid-client), uses the built-in Node.js `http` / `https` libraries, which do not support proxys by default. (See: [`http` docs](https://nodejs.org/dist/latest-v18.x/docs/api/http.html), [`https` docs](https://nodejs.org/dist/latest-v18.x/docs/api/https.html)).
Therefore, we'll need to an additional proxy agent to the http client, such as `https-proxy-agent`. `openid-client` allows the user to set an `agent` for requests ([Source](https://github.com/panva/node-openid-client/blob/main/docs/README.md#customizing-individual-http-requests).

View File

@@ -1,8 +1,8 @@
# Corporate proxy
Using NextAuth.js behind a corporate proxy is not supported out of the box. This is due to the fact that the underlying library we use, [`openid-client`](https://npm.im/openid-client) which uses the built-in Node.js `http` / `https` libraries, and those do not support proxys by default:
- [`http` docs](https://nodejs.org/dist/latest-v16.x/docs/api/http.html)
- [`https` docs](https://nodejs.org/dist/latest-v16.x/docs/api/https.html)
- [`http` docs](https://nodejs.org/dist/latest-v18.x/docs/api/http.html)
- [`https` docs](https://nodejs.org/dist/latest-v18.x/docs/api/https.html)
Therefore, we'll need to add an additional proxy agent to the http client, such as `https-proxy-agent`.

View File

@@ -40,7 +40,7 @@
"typescript": "4.8.4"
},
"engines": {
"node": "^12.19.0 || ^14.15.0 || ^16.13.0"
"node": "^12.19.0 || ^14.15.0 || ^16.13.0 || ^18.12.0"
},
"prettier": {
"semi": false,

View File

@@ -129,6 +129,6 @@
"whatwg-fetch": "^3.6.2"
},
"engines": {
"node": "^12.19.0 || ^14.15.0 || ^16.13.0"
"node": "^12.19.0 || ^14.15.0 || ^16.13.0 || ^18.12.0"
}
}