diff --git a/docs/docs/adapters/dgraph.md b/docs/docs/adapters/dgraph.md index d1951f1fca..8764929b4f 100644 --- a/docs/docs/adapters/dgraph.md +++ b/docs/docs/adapters/dgraph.md @@ -11,7 +11,7 @@ This is the Dgraph Adapter for [`next-auth`](https://next-auth.js.org). 1. Install the necessary packages -```bash npm2yarn +```bash npm2yarn2pnpm npm install next-auth @next-auth/dgraph-adapter ``` @@ -226,22 +226,22 @@ database you must customize next-auth `encode` and `decode` functions, as the de further customize the jwt with roles if you want to implement [`RBAC logic`](https://dgraph.io/docs/graphql/authorization/directive/#role-based-access-control). ```js -import * as jwt from "jsonwebtoken"; +import * as jwt from "jsonwebtoken" export default NextAuth({ session: { - strategy: "jwt" + strategy: "jwt", }, jwt: { secret: process.env.SECRET, encode: async ({ secret, token }) => { - return jwt.sign({...token, userId: token.id}, secret, { + return jwt.sign({ ...token, userId: token.id }, secret, { algorithm: "HS256", expiresIn: 30 * 24 * 60 * 60, // 30 days - }); + }) }, decode: async ({ secret, token }) => { - return jwt.verify(token, secret, { algorithms: ["HS256"] }); - } + return jwt.verify(token, secret, { algorithms: ["HS256"] }) + }, }, }) ``` diff --git a/docs/docs/adapters/dynamodb.md b/docs/docs/adapters/dynamodb.md index e91e3830fb..71def5b5cb 100644 --- a/docs/docs/adapters/dynamodb.md +++ b/docs/docs/adapters/dynamodb.md @@ -15,7 +15,7 @@ You can find the full schema in the table structure section below. 1. Install `next-auth` and `@next-auth/dynamodb-adapter` -```bash npm2yarn +```bash npm2yarn2pnpm npm install next-auth @next-auth/dynamodb-adapter ``` diff --git a/docs/docs/adapters/fauna.md b/docs/docs/adapters/fauna.md index 321e58f777..e5f1e64e61 100644 --- a/docs/docs/adapters/fauna.md +++ b/docs/docs/adapters/fauna.md @@ -13,7 +13,7 @@ You can find the Fauna schema and seed information in the docs at [next-auth.js. 1. Install the necessary packages -```bash npm2yarn +```bash npm2yarn2pnpm npm install next-auth @next-auth/fauna-adapter faunadb ``` diff --git a/docs/docs/adapters/firebase.md b/docs/docs/adapters/firebase.md index c8349316b2..8f06132e71 100644 --- a/docs/docs/adapters/firebase.md +++ b/docs/docs/adapters/firebase.md @@ -15,7 +15,7 @@ This is the Firebase Adapter for [`next-auth`](https://next-auth.js.org). This p 1. Install the necessary packages -```bash npm2yarn +```bash npm2yarn2pnpm npm install next-auth @next-auth/firebase-adapter@experimental ``` diff --git a/docs/docs/adapters/mikro-orm.md b/docs/docs/adapters/mikro-orm.md index 1a92e6eb68..d9a8bf48ff 100644 --- a/docs/docs/adapters/mikro-orm.md +++ b/docs/docs/adapters/mikro-orm.md @@ -5,7 +5,7 @@ title: MikroORM To use this Adapter, you need to install Mikro ORM, the driver that suits your database, and the separate `@next-auth/mikro-orm-adapter` package: -```bash npm2yarn +```bash npm2yarn2pnpm npm install next-auth @next-auth/mikro-orm-adapter @mikro-orm/core @mikro-orm/[YOUR DRIVER] ``` diff --git a/docs/docs/adapters/mongodb.md b/docs/docs/adapters/mongodb.md index 2a84a3c81c..b4bae7e1b7 100644 --- a/docs/docs/adapters/mongodb.md +++ b/docs/docs/adapters/mongodb.md @@ -11,7 +11,7 @@ The MongoDB adapter does not handle connections automatically, so you will have 1. Install the necessary packages -```bash npm2yarn +```bash npm2yarn2pnpm npm install next-auth @next-auth/mongodb-adapter mongodb ``` diff --git a/docs/docs/adapters/neo4j.md b/docs/docs/adapters/neo4j.md index b05130eec9..5a9698c5ee 100644 --- a/docs/docs/adapters/neo4j.md +++ b/docs/docs/adapters/neo4j.md @@ -11,7 +11,7 @@ This is the Neo4j Adapter for [`next-auth`](https://next-auth.js.org). This pack 1. Install the necessary packages -```bash npm2yarn +```bash npm2yarn2pnpm npm install next-auth @next-auth/neo4j-adapter neo4j-driver ``` diff --git a/docs/docs/adapters/pouchdb.md b/docs/docs/adapters/pouchdb.md index 98df5ec211..be2dbf05ba 100644 --- a/docs/docs/adapters/pouchdb.md +++ b/docs/docs/adapters/pouchdb.md @@ -19,7 +19,7 @@ Depending on your architecture you can use PouchDB's http adapter to reach any d 1. Install `next-auth` and `@next-auth/pouchdb-adapter` -```bash npm2yarn +```bash npm2yarn2pnpm npm install next-auth @next-auth/pouchdb-adapter ``` diff --git a/docs/docs/adapters/prisma.md b/docs/docs/adapters/prisma.md index 1c17188d8e..6c7ec9aa68 100644 --- a/docs/docs/adapters/prisma.md +++ b/docs/docs/adapters/prisma.md @@ -7,7 +7,7 @@ title: Prisma To use this Adapter, you need to install Prisma Client, Prisma CLI, and the separate `@next-auth/prisma-adapter` package: -```bash npm2yarn +```bash npm2yarn2pnpm npm install next-auth @prisma/client @next-auth/prisma-adapter npm install prisma --save-dev ``` diff --git a/docs/docs/adapters/sequelize.md b/docs/docs/adapters/sequelize.md index 4db48ef6aa..177d2ecc20 100644 --- a/docs/docs/adapters/sequelize.md +++ b/docs/docs/adapters/sequelize.md @@ -11,7 +11,7 @@ This is the Sequelize Adapter for [`next-auth`](https://next-auth.js.org). 1. Install the necessary packages -```bash npm2yarn +```bash npm2yarn2pnpm npm install next-auth @next-auth/sequelize-adapter sequelize ``` diff --git a/docs/docs/adapters/typeorm.md b/docs/docs/adapters/typeorm.md index 056663318e..67705902c5 100644 --- a/docs/docs/adapters/typeorm.md +++ b/docs/docs/adapters/typeorm.md @@ -19,7 +19,7 @@ In the future, we might split up this adapter to support single flavors of SQL f To use this Adapter, you need to install the following packages: -```bash npm2yarn +```bash npm2yarn2pnpm npm install next-auth @next-auth/typeorm-legacy-adapter typeorm ``` diff --git a/docs/docs/adapters/upstash-redis.md b/docs/docs/adapters/upstash-redis.md index 88d09db573..b90d315e8e 100644 --- a/docs/docs/adapters/upstash-redis.md +++ b/docs/docs/adapters/upstash-redis.md @@ -7,7 +7,7 @@ title: Upstash Redis To use this Adapter, you need to install `@upstash/redis` and `@next-auth/upstash-redis-adapter` package: -```bash npm2yarn +```bash npm2yarn2pnpm npm install @upstash/redis @next-auth/upstash-redis-adapter ``` diff --git a/docs/docs/getting-started/upgrade-to-v4.md b/docs/docs/getting-started/upgrade-to-v4.md index 8ca5b8aecd..496bbec2c2 100644 --- a/docs/docs/getting-started/upgrade-to-v4.md +++ b/docs/docs/getting-started/upgrade-to-v4.md @@ -13,7 +13,7 @@ We encourage users to try it out and report any and all issues they come across. You can upgrade to the new version by running: -```bash npm2yarn +```bash npm2yarn2pnpm npm install next-auth ``` diff --git a/docs/docs/tutorials/ldap-auth.md b/docs/docs/tutorials/ldap-auth.md index 73e6d746a5..4e6df8718c 100644 --- a/docs/docs/tutorials/ldap-auth.md +++ b/docs/docs/tutorials/ldap-auth.md @@ -7,7 +7,7 @@ NextAuth.js provides the ability to setup a [custom Credential provider](/config You will need an additional dependency, `ldapjs`, which you can install by running -```bash npm2yarn +```bash npm2yarn2pnpm npm install ldapjs ``` diff --git a/docs/docs/tutorials/testing-with-cypress.md b/docs/docs/tutorials/testing-with-cypress.md index f2bbd62881..055f0dd38a 100644 --- a/docs/docs/tutorials/testing-with-cypress.md +++ b/docs/docs/tutorials/testing-with-cypress.md @@ -9,7 +9,7 @@ To test an implementation of NextAuth.js, we encourage you to use [Cypress](http To get started, install the dependencies: -```bash npm2yarn +```bash npm2yarn2pnpm npm install --save-dev cypress cypress-social-logins @testing-library/cypress ``` diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 499f5fdb18..cd38452e31 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -155,9 +155,9 @@ module.exports = { showLastUpdateAuthor: true, showLastUpdateTime: true, remarkPlugins: [ + require("@sapphire/docusaurus-plugin-npm2yarn2pnpm").npm2yarn2pnpm, require("remark-github"), require("mdx-mermaid"), - [require("@docusaurus/remark-plugin-npm2yarn"), { sync: true }], ], versions: { current: { diff --git a/docs/package.json b/docs/package.json index 10b4b8783f..17f19824e9 100644 --- a/docs/package.json +++ b/docs/package.json @@ -21,9 +21,9 @@ "dependencies": { "@docusaurus/core": "^2.0.0-beta.21", "@docusaurus/preset-classic": "^2.0.0-beta.21", - "@docusaurus/remark-plugin-npm2yarn": "^2.0.0-beta.21", "@docusaurus/theme-common": "2.0.0-beta.21", "@mdx-js/react": "1.6.22", + "@sapphire/docusaurus-plugin-npm2yarn2pnpm": "^1.1.0", "classnames": "^2.3.1", "mdx-mermaid": "^1.2.2", "mermaid": "^9.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e248ddfdcb..4ef0fb4538 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -88,9 +88,9 @@ importers: '@docusaurus/core': ^2.0.0-beta.21 '@docusaurus/module-type-aliases': 2.0.0-beta.20 '@docusaurus/preset-classic': ^2.0.0-beta.21 - '@docusaurus/remark-plugin-npm2yarn': ^2.0.0-beta.21 '@docusaurus/theme-common': 2.0.0-beta.21 '@mdx-js/react': 1.6.22 + '@sapphire/docusaurus-plugin-npm2yarn2pnpm': ^1.1.0 classnames: ^2.3.1 mdx-mermaid: ^1.2.2 mermaid: ^9.0.1 @@ -104,9 +104,9 @@ importers: dependencies: '@docusaurus/core': 2.0.0-beta.21_biqbaboplfbrettd7655fr4n2y '@docusaurus/preset-classic': 2.0.0-beta.21_biqbaboplfbrettd7655fr4n2y - '@docusaurus/remark-plugin-npm2yarn': 2.0.0-beta.21 '@docusaurus/theme-common': 2.0.0-beta.21_biqbaboplfbrettd7655fr4n2y '@mdx-js/react': 1.6.22_react@18.2.0 + '@sapphire/docusaurus-plugin-npm2yarn2pnpm': 1.1.0 classnames: 2.3.1 mdx-mermaid: 1.2.3_mermaid@9.1.2+react@18.2.0 mermaid: 9.1.2 @@ -4155,15 +4155,6 @@ packages: react: 18.2.0 dev: false - /@docusaurus/remark-plugin-npm2yarn/2.0.0-beta.21: - resolution: {integrity: sha512-CqvmoFEj05NzaQBKxnsfI90aM8KHJZWyCzED/Qg5odUD9VtR9zNQJ1Nu/X1ctqCN7FBIxBYk2tz1Xb1+zCP8gg==} - engines: {node: '>=16.14'} - dependencies: - npm-to-yarn: 1.0.1 - tslib: 2.4.0 - unist-util-visit: 2.0.3 - dev: false - /@docusaurus/theme-classic/2.0.0-beta.21_biqbaboplfbrettd7655fr4n2y: resolution: {integrity: sha512-Ge0WNdTefD0VDQfaIMRRWa8tWMG9+8/OlBRd5MK88/TZfqdBq7b/gnCSaalQlvZwwkj6notkKhHx72+MKwWUJA==} engines: {node: '>=16.14'} @@ -5807,6 +5798,14 @@ packages: resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} dev: true + /@sapphire/docusaurus-plugin-npm2yarn2pnpm/1.1.0: + resolution: {integrity: sha512-AQGsbaxxJEFGWbLfzoXndT5waPNSQ708qvOz31aKwNilsftV22aBW1NMizxjLCQBooRr4dEWWBLxTGl9y4vKLg==} + engines: {node: '>=v16.6.0', npm: '>=7.0.0'} + dependencies: + npm-to-yarn: 1.0.1 + unist-util-visit: 2.0.3 + dev: false + /@shelf/jest-dynamodb/2.2.4_qsruu6yolbxs4rh6ixjhkibvwu: resolution: {integrity: sha512-OAnkP5sPcIoqL+q/tpp54psuK1gssm+nZLOHRy0S1eyAZGmuqiYAUzyAvmH5AhyqvDPSEHFkIkfbqlp1+KpHgw==} engines: {node: '>=14'}