mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
chore(docs): remaining authjs.dev and repo clean up (#6097)
This commit is contained in:
@@ -5,7 +5,7 @@ const path = require("path")
|
||||
module.exports = {
|
||||
root: true,
|
||||
parser: "@typescript-eslint/parser",
|
||||
extends: ["standard-with-typescript", "prettier"],
|
||||
extends: ["standard-with-typescript", "prettier/prettier"],
|
||||
rules: {
|
||||
camelcase: "off",
|
||||
"@typescript-eslint/naming-convention": "off",
|
||||
@@ -29,7 +29,7 @@ module.exports = {
|
||||
env: { jest: true },
|
||||
},
|
||||
{
|
||||
files: ["docs"],
|
||||
files: ["docs/**"],
|
||||
plugins: ["@docusaurus"],
|
||||
extends: ["plugin:@docusaurus/recommended"],
|
||||
},
|
||||
|
||||
1
.github/workflows/sync-examples.yml
vendored
1
.github/workflows/sync-examples.yml
vendored
@@ -16,3 +16,4 @@ jobs:
|
||||
with:
|
||||
GH_PAT: ${{ secrets.SYNC_EXAMPLE_PAT }}
|
||||
SKIP_PR: true
|
||||
ORIGINAL_MESSAGE: true
|
||||
|
||||
@@ -8,10 +8,10 @@ export default function Footer() {
|
||||
<hr />
|
||||
<ul className={styles.navItems}>
|
||||
<li className={styles.navItem}>
|
||||
<a href="https://next-auth.js.org">Documentation</a>
|
||||
<a href="https://authjs.dev">Documentation</a>
|
||||
</li>
|
||||
<li className={styles.navItem}>
|
||||
<a href="https://www.npmjs.com/package/next-auth">NPM</a>
|
||||
<a href="https://www.npmjs.com/package/@auth/core">NPM</a>
|
||||
</li>
|
||||
<li className={styles.navItem}>
|
||||
<a href="https://github.com/nextauthjs/next-auth-example">GitHub</a>
|
||||
|
||||
@@ -5,7 +5,8 @@ export default function Page () {
|
||||
<Layout>
|
||||
<h1>NextAuth.js Example</h1>
|
||||
<p>
|
||||
This is an example site to demonstrate how to use <a href='https://next-auth.js.org'>NextAuth.js</a> for authentication.
|
||||
This is an example site to demonstrate how to use{' '}
|
||||
<a href="https://authjs.dev">NextAuth.js</a> for authentication.
|
||||
</p>
|
||||
</Layout>
|
||||
)
|
||||
|
||||
@@ -1,29 +1,31 @@
|
||||
import Layout from '../components/layout'
|
||||
import Layout from "../components/layout"
|
||||
|
||||
export default function Page () {
|
||||
export default function Page() {
|
||||
return (
|
||||
<Layout>
|
||||
<p>
|
||||
This is an example site to demonstrate how to use <a href='https://next-auth.js.org'>NextAuth.js</a> for authentication.
|
||||
This is an example site to demonstrate how to use{" "}
|
||||
<a href="https://authjs.dev">Auth.js</a> for authentication.
|
||||
</p>
|
||||
<h2>Terms of Service</h2>
|
||||
<p>
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
</p>
|
||||
<h2>Privacy Policy</h2>
|
||||
<p>
|
||||
This site uses JSON Web Tokens and an in-memory database which resets every ~2 hours.
|
||||
This site uses JSON Web Tokens and an in-memory database which resets
|
||||
every ~2 hours.
|
||||
</p>
|
||||
<p>
|
||||
Data provided to this site is exclusively used to support signing in
|
||||
and is not passed to any third party services, other than via SMTP or OAuth for the
|
||||
purposes of authentication.
|
||||
Data provided to this site is exclusively used to support signing in and
|
||||
is not passed to any third party services, other than via SMTP or OAuth
|
||||
for the purposes of authentication.
|
||||
</p>
|
||||
</Layout>
|
||||
)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<p align="center">
|
||||
<br/>
|
||||
<a href="https://next-auth.js.org" target="_blank"><img width="150px" src="https://next-auth.js.org/img/logo/logo-sm.png" /></a>
|
||||
<a href="https://authjs.dev" target="_blank"><img width="150px" src="https://authjs.dev/img/logo/logo-sm.png" /></a>
|
||||
<h3 align="center">Auth.js Example App with <a href="https://kit.svelte.dev">SvelteKit</a></h3>
|
||||
<p align="center">
|
||||
Open Source. Full Stack. Own Your Data.
|
||||
@@ -25,4 +25,4 @@
|
||||
|
||||
# Documentation
|
||||
|
||||
- [sveltekit.authjs.dev](https://sveltekit.authjs.dev)
|
||||
- [sveltekit.authjs.dev](https://sveltekit.authjs.dev)
|
||||
|
||||
@@ -1,40 +1,40 @@
|
||||
> The example repository is maintained from a [monorepo](https://github.com/nextauthjs/next-auth/tree/main/apps/example-gatsby). Pull Requests should be opened against [`nextauthjs/next-auth`](https://github.com/nextauthjs/next-auth).
|
||||
> The example repository is maintained from a [monorepo](https://github.com/nextauthjs/next-auth/tree/main/apps/playground-gatsby). Pull Requests should be opened against [`nextauthjs/next-auth`](https://github.com/nextauthjs/next-auth).
|
||||
|
||||
<p align="center">
|
||||
<br/>
|
||||
<a href="https://next-auth.js.org" target="_blank"><img width="150px" src="https://next-auth.js.org/img/logo/logo-sm.png" /></a>
|
||||
<h3 align="center">NextAuth.js Example App</h3>
|
||||
<a href="https://authjs.dev" target="_blank"><img width="150px" src="https://authjs.dev/img/logo/logo-sm.png" /></a>
|
||||
<h3 align="center">Auth.js Example App</h3>
|
||||
<p align="center">
|
||||
Open Source. Full Stack. Own Your Data.
|
||||
</p>
|
||||
<p align="center" style="align: center;">
|
||||
<a href="https://npm.im/next-auth">
|
||||
<img alt="npm" src="https://img.shields.io/npm/v/next-auth?color=green&label=next-auth&style=flat-square">
|
||||
<img alt="npm" src="https://img.shields.io/npm/v/@auth/core?color=green&label=@auth/core&style=flat-square">
|
||||
</a>
|
||||
<a href="https://bundlephobia.com/result?p=next-auth-example">
|
||||
<img src="https://img.shields.io/bundlephobia/minzip/next-auth?label=bundle&style=flat-square" alt="Bundle Size"/>
|
||||
<a href="https://bundlephobia.com/result?p=@auth/core">
|
||||
<img src="https://img.shields.io/bundlephobia/minzip/@auth/core?label=bundle&style=flat-square" alt="Bundle Size"/>
|
||||
</a>
|
||||
<a href="https://www.npmtrends.com/next-auth">
|
||||
<img src="https://img.shields.io/npm/dm/next-auth?label=20downloads&style=flat-square" alt="Downloads" />
|
||||
<a href="https://www.npmtrends.com/@auth/core">
|
||||
<img src="https://img.shields.io/npm/dm/@auth/core?label=downloads&style=flat-square" alt="Downloads" />
|
||||
</a>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
## Overview
|
||||
|
||||
NextAuth.js is a complete open source authentication solution.
|
||||
Auth.js is a complete open source authentication solution.
|
||||
|
||||
This is an example application that shows how `next-auth` is applied to a basic Gatsby app. We are showing how to configure the backend both as a [Vercel Function](https://vercel.com/docs/concepts/functions/introduction) for deployment to Vercel, and also for [Gatsby Functions](https://www.gatsbyjs.com/docs/reference/functions) for other platforms.
|
||||
This is an example application that shows how `@auth/core` is applied to a basic Gatsby app. We are showing how to configure the backend both as a [Vercel Function](https://vercel.com/docs/concepts/functions/introduction) for deployment to Vercel, and also for [Gatsby Functions](https://www.gatsbyjs.com/docs/reference/functions) for other platforms.
|
||||
|
||||
The deployed version can be found at [`next-auth-gatsby-example.vercel.app`](https://next-auth-gatsby-example.vercel.app)
|
||||
|
||||
### About NextAuth.js
|
||||
### About Auth.js
|
||||
|
||||
NextAuth.js is an easy to implement, full-stack (client/server) open source authentication library originally designed for [Next.js](https://nextjs.org) and [Serverless](https://vercel.com), but this example shows how to use it in a Gatsby project. Our goal is to [support even more frameworks](https://github.com/nextauthjs/next-auth/issues/2294) in the future.
|
||||
Auth.js is an easy to implement, full-stack (client/server) open source authentication library originally designed for [Next.js](https://nextjs.org) and [Serverless](https://vercel.com), but this example shows how to use it in a Gatsby project. Our goal is to [support even more frameworks](https://github.com/nextauthjs/next-auth/issues/2294) in the future.
|
||||
|
||||
Go to [next-auth.js.org](https://next-auth.js.org) for more information and documentation.
|
||||
Go to [authjs.dev](https://authjs.dev) for more information and documentation.
|
||||
|
||||
> *NextAuth.js is not officially associated with Vercel or Next.js.*
|
||||
> Auth.js is not officially associated with Vercel or Next.js._
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -58,13 +58,13 @@ Add details for one or more providers (e.g. Google, Twitter, GitHub, Email, etc)
|
||||
|
||||
#### Database
|
||||
|
||||
A database is needed to persist user accounts and to support email sign in. However, you can still use NextAuth.js for authentication without a database by using OAuth for authentication. If you do not specify a database, [JSON Web Tokens](https://jwt.io/introduction) will be enabled by default.
|
||||
A database is needed to persist user accounts and to support email sign in. However, you can still use Auth.js for authentication without a database by using OAuth for authentication. If you do not specify a database, [JSON Web Tokens](https://jwt.io/introduction) will be enabled by default.
|
||||
|
||||
You **can** skip configuring a database and come back to it later if you want.
|
||||
|
||||
For more information about setting up a database, please check out the following links:
|
||||
|
||||
* Docs: [next-auth.js.org/adapters/overview](https://next-auth.js.org/adapters/overview)
|
||||
- Docs: [authjs.dev/reference/adapters/overview](https://authjs.dev/reference/adapters/overview)
|
||||
|
||||
### 3. Configure Authentication Providers
|
||||
|
||||
@@ -72,9 +72,9 @@ For more information about setting up a database, please check out the following
|
||||
|
||||
2. When setting up OAuth, in the developer admin page for each of your OAuth services, you should configure the callback URL to use a callback path of `{server}/api/auth/callback/{provider}`.
|
||||
|
||||
e.g. For Google OAuth you would use: `http://localhost:3000/api/auth/callback/google`
|
||||
e.g. For Google OAuth you would use: `http://localhost:3000/api/auth/callback/google`
|
||||
|
||||
A list of configured providers and their callback URLs is available from the endpoint `/api/auth/providers`. You can find more information at https://next-auth.js.org/configuration/providers/oauth
|
||||
A list of configured providers and their callback URLs is available from the endpoint `/api/auth/providers`. You can find more information at [authjs.dev/reference/providers/oauth-builtin](https://authjs.dev/reference/providers/oauth-builtin).
|
||||
|
||||
3. You can also choose to specify an SMTP server for passwordless sign in via email.
|
||||
|
||||
@@ -95,16 +95,15 @@ npm run start
|
||||
|
||||
### 5. Preparing for Production
|
||||
|
||||
Follow the [Deployment documentation](https://next-auth.js.org/deployment)
|
||||
Follow the [Deployment documentation](https://authjs.dev/guides/basics/deployment)
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
<a href="https://vercel.com?utm_source=nextauthjs&utm_campaign=oss">
|
||||
<img width="170px" src="https://raw.githubusercontent.com/nextauthjs/next-auth/canary/www/static/img/powered-by-vercel.svg" alt="Powered By Vercel" />
|
||||
<a href="https://vercel.com?utm_source=authjs&utm_campaign=oss">
|
||||
<img width="170px" src="https://powered-by-vercel.api.soraharu.com/powered-by-vercel.svg" alt="Powered By Vercel" />
|
||||
</a>
|
||||
<p align="left">Thanks to Vercel sponsoring this project by allowing it to be deployed for free for the entire NextAuth.js Team</p>
|
||||
<p align="left">Thanks to Vercel sponsoring this project by allowing it to be deployed for free for the entire Auth.js Team</p>
|
||||
|
||||
## License
|
||||
|
||||
ISC
|
||||
|
||||
|
||||
@@ -11,8 +11,7 @@ export default function Home() {
|
||||
<h1>NextAuth.js Example</h1>
|
||||
<p>
|
||||
An example site to demonstrate how to use{" "}
|
||||
<a href="https://next-auth.js.org">NextAuth.js</a> for authentication in
|
||||
Gatsby.
|
||||
<a href="https://authjs.dev">Auth.js</a> for authentication in Gatsby.
|
||||
</p>
|
||||
{
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<p align="center">
|
||||
<br/>
|
||||
<a href="https://next-auth.js.org" target="_blank"><img width="150px" src="https://next-auth.js.org/img/logo/logo-sm.png" /></a>
|
||||
<h3 align="center">NextAuth.js</h3>
|
||||
<a href="https://authjs.dev" target="_blank"><img width="150px" src="https://authjs.dev/img/logo/logo-sm.png" /></a>
|
||||
<h3 align="center">Auth.js</h3>
|
||||
<p align="center">Authentication for Next.js</p>
|
||||
<p align="center">
|
||||
Open Source. Full Stack. Own Your Data.
|
||||
@@ -10,16 +10,16 @@
|
||||
<a href="https://github.com/nextauthjs/next-auth/actions/workflows/release.yml?query=workflow%3ARelease">
|
||||
<img src="https://github.com/nextauthjs/next-auth/actions/workflows/release.yml/badge.svg" alt="Release" />
|
||||
</a>
|
||||
<a href="https://packagephobia.com/result?p=next-auth">
|
||||
<img src="https://packagephobia.com/badge?p=next-auth" alt="Bundle Size"/>
|
||||
<a href="https://packagephobia.com/result?p=@auth/core">
|
||||
<img src="https://packagephobia.com/badge?p=@auth/core" alt="Bundle Size"/>
|
||||
</a>
|
||||
<a href="https://www.npmtrends.com/next-auth">
|
||||
<img src="https://img.shields.io/npm/dm/next-auth" alt="Downloads" />
|
||||
<a href="https://www.npmtrends.com/@auth/core">
|
||||
<img src="https://img.shields.io/npm/dm/@auth/core" alt="Downloads" />
|
||||
</a>
|
||||
<a href="https://github.com/nextauthjs/next-auth/stargazers">
|
||||
<img src="https://img.shields.io/github/stars/nextauthjs/next-auth" alt="Github Stars" />
|
||||
</a>
|
||||
<a href="https://www.npmjs.com/package/next-auth">
|
||||
<a href="https://www.npmjs.com/package/@auth/core">
|
||||
<img src="https://img.shields.io/github/v/release/nextauthjs/next-auth?label=latest" alt="Github Stable Release" />
|
||||
</a>
|
||||
</p>
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
## Overview
|
||||
|
||||
This is the repository for the documentation page for NextAuth.js!
|
||||
This is the repository for the documentation page for Auth.js!
|
||||
|
||||
NextAuth.js is a complete open source authentication solution for [Next.js](http://nextjs.org/) applications.
|
||||
|
||||
|
||||
5
docs/docs/concepts/_category_.json
Normal file
5
docs/docs/concepts/_category_.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"label": "Concepts",
|
||||
"collapsible": true,
|
||||
"collapsed": true
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Contributors
|
||||
displayed_sidebar: null
|
||||
---
|
||||
|
||||
## Core team
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Introduction
|
||||
sidebar_position: 0
|
||||
---
|
||||
|
||||
## About Auth.js
|
||||
|
||||
@@ -269,7 +269,7 @@ The `session.jwt: boolean` option has been renamed to `session.strategy: "jwt" |
|
||||
|
||||
1. No adapter, `strategy: "jwt"`: This is the default. The session is saved in a cookie and never persisted anywhere.
|
||||
2. With Adapter, `strategy: "database"`: If an Adapter is defined, this will be the implicit setting. No user config is needed.
|
||||
3. With Adapter, `strategy: "jwt"`: The user can explicitly instruct `next-auth` to use JWT even if a database is available. This can result in faster lookups in compromise of lowered security. Read more about: https://next-auth.js.org/faq#json-web-tokens
|
||||
3. With Adapter, `strategy: "jwt"`: The user can explicitly instruct `next-auth` to use JWT even if a database is available. This can result in faster lookups in compromise of lowered security. Read more about: https://authjs.dev/concepts/faq#json-web-tokens
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
5
docs/docs/getting-started/_category_.json
Normal file
5
docs/docs/getting-started/_category_.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"label": "Getting Started",
|
||||
"collapsible": true,
|
||||
"collapsed": true
|
||||
}
|
||||
@@ -12,7 +12,7 @@ A working example can be accessed [here](https://github.com/nextauthjs/next-auth
|
||||
|
||||
### Server Side
|
||||
|
||||
Using a [JWT callback](https://next-auth.js.org/configuration/callbacks#jwt-callback) and a [session callback](https://next-auth.js.org/configuration/callbacks#session-callback), we can persist OAuth tokens and refresh them when they expire.
|
||||
Using a [JWT callback](https://authjs.dev/guides/basics/callbacks#jwt-callback) and a [session callback](https://authjs.dev/guides/basics/callbacks#session-callback), we can persist OAuth tokens and refresh them when they expire.
|
||||
|
||||
Below is a sample implementation using Google's Identity Provider. Please note that the OAuth 2.0 request in the `refreshAccessToken()` function will vary between different providers, but the core logic should remain similar.
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ This tutorial covers:
|
||||
|
||||
#### [Using Auth.js with Magic links](https://dev.to/narciero/using-nextauth-js-with-magic-links-df4) <svg style={{ marginLeft: '5px', marginBottom:'-6px'}} width="30" height="25" viewBox="0 0 50 40" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="50" height="40" rx="3" style={{ fill: '#000' }}></rect><path d="M19.099 23.508c0 1.31-.423 2.388-1.27 3.234-.838.839-1.942 1.258-3.312 1.258h-4.403V12.277h4.492c1.31 0 2.385.423 3.224 1.27.846.838 1.269 1.912 1.269 3.223v6.738zm-2.808 0V16.77c0-.562-.187-.981-.562-1.258-.374-.285-.748-.427-1.122-.427h-1.685v10.107h1.684c.375 0 .75-.138 1.123-.415.375-.285.562-.708.562-1.27zM28.185 28h-5.896c-.562 0-1.03-.187-1.404-.561-.375-.375-.562-.843-.562-1.404V14.243c0-.562.187-1.03.562-1.404.374-.375.842-.562 1.404-.562h5.896v2.808H23.13v3.65h3.088v2.808h-3.088v3.65h5.054V28zm7.12 0c-.936 0-1.684-.655-2.246-1.965l-3.65-13.758h3.089l2.807 10.804 2.808-10.804H41.2l-3.65 13.758C36.99 27.345 36.241 28 35.305 28z" style={{ fill: '#fff' }}></path></svg>
|
||||
|
||||
- Learn how to use [Magic.Link](https://magic.link) authentication with [Auth.js](https://next-auth.js.org) to enable passwordless authentication without a database.
|
||||
- Learn how to use [Magic.Link](https://magic.link) authentication with [Auth.js](https://authjs.dev) to enable passwordless authentication without a database.
|
||||
|
||||
## Database
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
---
|
||||
title: Overview
|
||||
sidebar_label: Guides
|
||||
sidebar_position: 0
|
||||
---
|
||||
|
||||
We're creating internal guides to help understand how to use Auth.js and all the possible configurations and uses cases it supports.
|
||||
@@ -190,4 +190,4 @@ An advanced option, hopefully you won't need it in most cases. `next-auth` uses
|
||||
|
||||
### `allowDangerousEmailAccountLinking` option
|
||||
|
||||
Normally, when you sign in with an OAuth provider and another account with the same email address already exists, the accounts are not linked automatically. Automatic account linking on sign in is not secure between arbitrary providers and is disabled by default (see our [Security FAQ](https://next-auth.js.org/faq#security)). However, it may be desirable to allow automatic account linking if you trust that the provider involved has securely verified the email address associated with the account. Just set `allowDangerousEmailAccountLinking: true` in your provider configuration to enable automatic account linking.
|
||||
Normally, when you sign in with an OAuth provider and another account with the same email address already exists, the accounts are not linked automatically. Automatic account linking on sign in is not secure between arbitrary providers and is disabled by default (see our [Security FAQ](https://authjs.dev/reference/faq#security)). However, it may be desirable to allow automatic account linking if you trust that the provider involved has securely verified the email address associated with the account. Just set `allowDangerousEmailAccountLinking: true` in your provider configuration to enable automatic account linking.
|
||||
|
||||
@@ -38,7 +38,7 @@ AZURE_AD_TENANT_ID=<copy the tenant id here>
|
||||
That will default the tenant to use the `common` authorization endpoint. [For more details see here](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols#endpoints).
|
||||
|
||||
:::note
|
||||
Azure AD returns the profile picture in an ArrayBuffer, instead of just a URL to the image, so our provider converts it to a base64 encoded image string and returns that instead. See: https://docs.microsoft.com/en-us/graph/api/profilephoto-get?view=graph-rest-1.0#examples. The default image size is 48x48 to avoid [running out of space](https://next-auth.js.org/faq#:~:text=What%20are%20the%20disadvantages%20of%20JSON%20Web%20Tokens%3F) in case the session is saved as a JWT.
|
||||
Azure AD returns the profile picture in an ArrayBuffer, instead of just a URL to the image, so our provider converts it to a base64 encoded image string and returns that instead. See: https://docs.microsoft.com/en-us/graph/api/profilephoto-get?view=graph-rest-1.0#examples. The default image size is 48x48 to avoid [running out of space](https://authjs.dev/concepts/faq#:~:text=What%20are%20the%20disadvantages%20of%20JSON%20Web%20Tokens%3F) in case the session is saved as a JWT.
|
||||
:::
|
||||
|
||||
In `pages/api/auth/[...nextauth].js` find or add the `AzureAD` entries:
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
title: Database Adapters
|
||||
---
|
||||
|
||||
|
||||
:::warning WIP
|
||||
`@auth/*-adapter` is work in progress. for the time being, please go to [NextAuth.js Adapters](https://next-auth.js.org/adapters/overview).
|
||||
:::
|
||||
|
||||
|
||||
|
||||
@@ -7,42 +7,42 @@ Auth.js can be used with any database. Models tell you what structures Auth.js e
|
||||
|
||||
```mermaid
|
||||
erDiagram
|
||||
User ||--|{ Account : ""
|
||||
User {
|
||||
string id
|
||||
string name
|
||||
string email
|
||||
timestamp emailVerified
|
||||
string image
|
||||
}
|
||||
User ||--|{ Session : ""
|
||||
Session {
|
||||
string id
|
||||
timestamp expires
|
||||
string sessionToken
|
||||
string userId
|
||||
}
|
||||
Account {
|
||||
string id
|
||||
string userId
|
||||
string type
|
||||
string provider
|
||||
string providerAccountId
|
||||
string refresh_token
|
||||
string access_token
|
||||
int expires_at
|
||||
string token_type
|
||||
string scope
|
||||
string id_token
|
||||
string session_state
|
||||
string oauth_token_secret
|
||||
string oauth_token
|
||||
}
|
||||
VerificationToken {
|
||||
string identifier
|
||||
string token
|
||||
timestamp expires
|
||||
}
|
||||
User ||--|{ Account : ""
|
||||
User {
|
||||
string id
|
||||
string name
|
||||
string email
|
||||
timestamp emailVerified
|
||||
string image
|
||||
}
|
||||
User ||--|{ Session : ""
|
||||
Session {
|
||||
string id
|
||||
timestamp expires
|
||||
string sessionToken
|
||||
string userId
|
||||
}
|
||||
Account {
|
||||
string id
|
||||
string userId
|
||||
string type
|
||||
string provider
|
||||
string providerAccountId
|
||||
string refresh_token
|
||||
string access_token
|
||||
int expires_at
|
||||
string token_type
|
||||
string scope
|
||||
string id_token
|
||||
string session_state
|
||||
string oauth_token_secret
|
||||
string oauth_token
|
||||
}
|
||||
VerificationToken {
|
||||
string identifier
|
||||
string token
|
||||
timestamp expires
|
||||
}
|
||||
```
|
||||
|
||||
More information about each Model / Table can be found below.
|
||||
|
||||
@@ -3,7 +3,7 @@ id: dgraph
|
||||
title: Dgraph
|
||||
---
|
||||
|
||||
This is the Dgraph Adapter for [`next-auth`](https://next-auth.js.org).
|
||||
This is the Dgraph Adapter for [`next-auth`](https://authjs.dev).
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -20,9 +20,9 @@ import NextAuth from "next-auth"
|
||||
import { DgraphAdapter } from "@next-auth/dgraph-adapter"
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/configuration/auth-options
|
||||
export default NextAuth({
|
||||
// https://next-auth.js.org/configuration/providers
|
||||
// https://authjs.dev/reference/provideres/oauth-builtin
|
||||
providers: [],
|
||||
adapter: DgraphAdapter({
|
||||
endpoint: process.env.DGRAPH_GRAPHQL_ENDPOINT,
|
||||
|
||||
@@ -3,9 +3,9 @@ id: fauna
|
||||
title: FaunaDB
|
||||
---
|
||||
|
||||
This is the Fauna Adapter for [`next-auth`](https://next-auth.js.org). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
This is the Fauna Adapter for [`next-auth`](https://authjs.dev). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
|
||||
You can find the Fauna schema and seed information in the docs at [next-auth.js.org/adapters/fauna](https://next-auth.js.org/adapters/fauna).
|
||||
You can find the Fauna schema and seed information in the docs at [authjs.dev/reference/adapters/fauna](https://authjs.dev/reference/adapters/fauna).
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -30,9 +30,9 @@ const client = new FaunaClient({
|
||||
})
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/configuration/auth-options
|
||||
export default NextAuth({
|
||||
// https://next-auth.js.org/providers/overview
|
||||
// https://authjs.dev/reference/providers/
|
||||
providers: [],
|
||||
adapter: FaunaAdapter(client)
|
||||
...
|
||||
|
||||
@@ -7,7 +7,7 @@ title: Firebase
|
||||
This adapter is still experimental and does not work with Auth.js 4 or newer. If you would like to help out upgrading it, please visit [this PR](https://github.com/nextauthjs/next-auth/pull/3873)
|
||||
:::
|
||||
|
||||
This is the Firebase Adapter for [`next-auth`](https://next-auth.js.org). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
This is the Firebase Adapter for [`next-auth`](https://authjs.dev). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -32,9 +32,9 @@ const firestore = (
|
||||
).firestore()
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/configuration/auth-options
|
||||
export default NextAuth({
|
||||
// https://next-auth.js.org/providers/overview
|
||||
// https://authjs.dev/reference/providers/
|
||||
providers: [
|
||||
GoogleProvider({
|
||||
clientId: process.env.GOOGLE_ID,
|
||||
|
||||
@@ -56,7 +56,7 @@ import { MongoDBAdapter } from "@next-auth/mongodb-adapter"
|
||||
import clientPromise from "../../../lib/mongodb"
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/providers/oauth
|
||||
export default NextAuth({
|
||||
adapter: MongoDBAdapter(clientPromise),
|
||||
...
|
||||
|
||||
@@ -3,7 +3,7 @@ id: neo4j
|
||||
title: Neo4j
|
||||
---
|
||||
|
||||
This is the Neo4j Adapter for [`next-auth`](https://next-auth.js.org). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
This is the Neo4j Adapter for [`next-auth`](https://authjs.dev). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -27,9 +27,9 @@ const driver = neo4j.driver(
|
||||
const neo4jSession = driver.session()
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/configuration/auth-options
|
||||
export default NextAuth({
|
||||
// https://next-auth.js.org/configuration/providers
|
||||
// https://authjs.dev/reference/providers/oauth-builtin
|
||||
providers: [],
|
||||
adapter: Neo4jAdapter(neo4jSession),
|
||||
...
|
||||
|
||||
@@ -7,7 +7,7 @@ title: PouchDB
|
||||
This adapter is still experimental and does not work with Auth.js 4 or newer. If you would like to help out upgrading it, please [open a PR](https://github.com/nextauthjs/next-auth/tree/main/packages)
|
||||
:::
|
||||
|
||||
This is the PouchDB Adapter for [`next-auth`](https://next-auth.js.org). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
This is the PouchDB Adapter for [`next-auth`](https://authjs.dev). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
|
||||
Depending on your architecture you can use PouchDB's http adapter to reach any database compliant with the CouchDB protocol (CouchDB, Cloudant, ...) or use any other PouchDB compatible adapter (leveldb, in-memory, ...)
|
||||
|
||||
@@ -36,9 +36,9 @@ PouchDB.plugin(require("pouchdb-adapter-leveldb")) // Any other adapter
|
||||
const pouchdb = new PouchDB("auth_db", { adapter: "leveldb" })
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/configuration/auth-options
|
||||
export default NextAuth({
|
||||
// https://next-auth.js.org/providers/overview
|
||||
// https://authjs.dev/reference/providers/
|
||||
providers: [
|
||||
GoogleProvider({
|
||||
clientId: process.env.GOOGLE_ID,
|
||||
|
||||
@@ -3,7 +3,7 @@ id: sequelize
|
||||
title: Sequelize
|
||||
---
|
||||
|
||||
This is the Sequelize Adapter for [`next-auth`](https://next-auth.js.org).
|
||||
This is the Sequelize Adapter for [`next-auth`](https://authjs.dev).
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -28,9 +28,9 @@ import { Sequelize } from "sequelize"
|
||||
const sequelize = new Sequelize("yourconnectionstring")
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/configuration/auth-config
|
||||
export default NextAuth({
|
||||
// https://next-auth.js.org/providers/overview
|
||||
// https://authjs.dev/reference/providers/
|
||||
providers: [],
|
||||
adapter: SequelizeAdapter(sequelize),
|
||||
})
|
||||
@@ -38,7 +38,7 @@ export default NextAuth({
|
||||
|
||||
## Updating the database schema
|
||||
|
||||
By default, the sequelize adapter will not create tables in your database. In production, best practice is to create the [required tables](https://next-auth.js.org/adapters/models) in your database via [migrations](https://sequelize.org/master/manual/migrations.html). In development, you are able to call [`sequelize.sync()`](https://sequelize.org/master/manual/model-basics.html#model-synchronization) to have sequelize create the necessary tables, foreign keys and indexes:
|
||||
By default, the sequelize adapter will not create tables in your database. In production, best practice is to create the [required tables](https://authjs.dev/reference/adapters/models) in your database via [migrations](https://sequelize.org/master/manual/migrations.html). In development, you are able to call [`sequelize.sync()`](https://sequelize.org/master/manual/model-basics.html#model-synchronization) to have sequelize create the necessary tables, foreign keys and indexes:
|
||||
|
||||
> This schema is adapted for use in Sequelize and based upon our main [schema](/reference/adapters/models)
|
||||
|
||||
@@ -72,7 +72,7 @@ import Sequelize, { DataTypes } from "sequelize"
|
||||
const sequelize = new Sequelize("sqlite::memory:")
|
||||
|
||||
export default NextAuth({
|
||||
// https://next-auth.js.org/providers/overview
|
||||
// https://authjs.dev/reference/providers/
|
||||
providers: [],
|
||||
adapter: SequelizeAdapter(sequelize, {
|
||||
models: {
|
||||
|
||||
@@ -5,12 +5,12 @@ title: Supabase
|
||||
|
||||
# Supabase
|
||||
|
||||
This is the Supabase Adapter for [`next-auth`](https://next-auth.js.org). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
This is the Supabase Adapter for [`next-auth`](https://authjs.dev). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
|
||||
:::note
|
||||
This adapter is developed by the community and not officially maintained or supported by Supabase. It uses the Supabase Database to store user and session data in a separate `next_auth` schema. It is a standalone Auth server that does not interface with Supabase Auth and therefore provides a different feature set.
|
||||
|
||||
If you’re looking for an officially maintained Auth server with additional features like [built-in email server](https://supabase.com/docs/guides/auth/auth-email#configure-email-settings?utm_source=next-auth-docs&medium=referral&campaign=next-auth), [phone auth](https://supabase.com/docs/guides/auth/auth-twilio?utm_source=next-auth-docs&medium=referral&campaign=next-auth), and [Multi Factor Authentication (MFA / 2FA)](https://supabase.com/contact/mfa?utm_source=next-auth-docs&medium=referral&campaign=next-auth), please use [Supabase Auth](https://supabase.com/auth) with the [Auth Helpers for Next.js](https://supabase.com/docs/guides/auth/auth-helpers/nextjs?utm_source=next-auth-docs&medium=referral&campaign=next-auth).
|
||||
If you’re looking for an officially maintained Auth server with additional features like [built-in email server](https://supabase.com/docs/guides/auth/auth-email#configure-email-settings?utm_source=authjs-docs&medium=referral&campaign=authjs), [phone auth](https://supabase.com/docs/guides/auth/auth-twilio?utm_source=authjs-docs&medium=referral&campaign=authjs), and [Multi Factor Authentication (MFA / 2FA)](https://supabase.com/contact/mfa?utm_source=authjs-docs&medium=referral&campaign=authjs), please use [Supabase Auth](https://supabase.com/auth) with the [Auth Helpers for Next.js](https://supabase.com/docs/guides/auth/auth-helpers/nextjs?utm_source=authjs-docs&medium=referral&campaign=authjs).
|
||||
:::
|
||||
|
||||
## Getting Started
|
||||
@@ -28,9 +28,9 @@ import NextAuth from "next-auth"
|
||||
import { SupabaseAdapter } from "@next-auth/supabase-adapter"
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/configuration/auth-config
|
||||
export default NextAuth({
|
||||
// https://next-auth.js.org/configuration/providers
|
||||
// https://authjs.dev/reference/providers/oauth-builtin
|
||||
providers: [...],
|
||||
adapter: SupabaseAdapter({
|
||||
url: process.env.NEXT_PUBLIC_SUPABASE_URL,
|
||||
@@ -46,7 +46,7 @@ export default NextAuth({
|
||||
|
||||
Setup your database as described in our main [schema](/reference/adapters/models), by copying the SQL schema below in the Supabase [SQL Editor](https://app.supabase.com/project/_/sql).
|
||||
|
||||
Alternatively you can select the NextAuth Quickstart card on the [SQL Editor page](https://app.supabase.com/project/_/sql), or [create a migration with the Supabase CLI](https://supabase.com/docs/guides/cli/local-development#database-migrations?utm_source=next-auth-docs&medium=referral&campaign=next-auth).
|
||||
Alternatively you can select the NextAuth Quickstart card on the [SQL Editor page](https://app.supabase.com/project/_/sql), or [create a migration with the Supabase CLI](https://supabase.com/docs/guides/cli/local-development#database-migrations?utm_source=authjs-docs&medium=referral&campaign=authjs).
|
||||
|
||||
```sql
|
||||
--
|
||||
@@ -156,13 +156,13 @@ GRANT ALL ON TABLE next_auth.verification_tokens TO service_role;
|
||||
|
||||
Expose the `next_auth` schema via the Serverless API in the [API settings](https://app.supabase.com/project/_/settings/api) by adding `next_auth` to the "Exposed schemas" list.
|
||||
|
||||
When developing locally add `next_auth` to the `schemas` array in the `config.toml` file in the `supabase` folder that was generated by the [Supabase CLI](https://supabase.com/docs/guides/cli/local-development#initialize-your-project?utm_source=next-auth-docs&medium=referral&campaign=next-auth).
|
||||
When developing locally add `next_auth` to the `schemas` array in the `config.toml` file in the `supabase` folder that was generated by the [Supabase CLI](https://supabase.com/docs/guides/cli/local-development#initialize-your-project?utm_source=authjs-docs&medium=referral&campaign=authjs).
|
||||
|
||||
## Enabling Row Level Security (RLS)
|
||||
|
||||
Postgres provides a powerful feature called [Row Level Security (RLS)](https://supabase.com/docs/guides/auth/row-level-security?utm_source=next-auth-docs&medium=referral&campaign=next-auth) to limit access to data.
|
||||
Postgres provides a powerful feature called [Row Level Security (RLS)](https://supabase.com/docs/guides/auth/row-level-security?utm_source=authjs-docs&medium=referral&campaign=authjs) to limit access to data.
|
||||
|
||||
This works by sending a signed JWT to your [Supabase Serverless API](https://supabase.com/docs/guides/api?utm_source=next-auth-docs&medium=referral&campaign=next-auth). There is two steps to make this work with NextAuth:
|
||||
This works by sending a signed JWT to your [Supabase Serverless API](https://supabase.com/docs/guides/api?utm_source=authjs-docs&medium=referral&campaign=authjs). There is two steps to make this work with NextAuth:
|
||||
|
||||
### 1. Generate the Supabase `access_token` JWT in the session callback
|
||||
|
||||
@@ -182,9 +182,9 @@ import { SupabaseAdapter } from "@next-auth/supabase-adapter"
|
||||
import jwt from "jsonwebtoken"
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/configuration/auth-options
|
||||
export default NextAuth({
|
||||
// https://next-auth.js.org/configuration/providers
|
||||
// https://authjs.dev/reference/providers/oauth-builtin
|
||||
providers: [...],
|
||||
adapter: SupabaseAdapter({
|
||||
url: process.env.NEXT_PUBLIC_SUPABASE_URL,
|
||||
|
||||
@@ -27,11 +27,11 @@ These warnings are displayed on the terminal.
|
||||
|
||||
#### NO_SECRET
|
||||
|
||||
In development, we generate a `secret` based on your configuration for convenience. This is volatile and will throw an error in production. [Read more](https://next-auth.js.org/configuration/options#secret)
|
||||
In development, we generate a `secret` based on your configuration for convenience. This is volatile and will throw an error in production. [Read more](https://authjs.dev/reference/configuration/auth-config/#secret)
|
||||
|
||||
#### TWITTER_OAUTH_2_BETA
|
||||
|
||||
Twitter OAuth 2.0 is currently in beta as certain changes might still be necessary. This is not covered by semver. See the docs https://next-auth.js.org/providers/twitter#oauth-2
|
||||
Twitter OAuth 2.0 is currently in beta as certain changes might still be necessary. This is not covered by semver. See the docs https://authjs.dev/reference/providers/twitter#oauth-2
|
||||
|
||||
#### EXPERIMENTAL_API
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
---
|
||||
title: Overview
|
||||
sidebar_label: Overview
|
||||
sidebar_position: 0
|
||||
---
|
||||
|
||||
## Core
|
||||
@@ -20,4 +22,4 @@ title: Overview
|
||||
- Remix
|
||||
- Nuxt
|
||||
- Gatsby
|
||||
- etc.
|
||||
- etc.
|
||||
|
||||
@@ -12,7 +12,7 @@ const typedocConfig = require("./typedoc.json")
|
||||
delete typedocConfig.$schema
|
||||
|
||||
/** @type {import("@docusaurus/types").Config} */
|
||||
module.exports = {
|
||||
const docusaurusConfig = {
|
||||
title: "Auth.js",
|
||||
tagline: "Authentication for the Web.",
|
||||
url: "https://authjs.dev",
|
||||
@@ -20,9 +20,9 @@ module.exports = {
|
||||
favicon: "img/favicon.ico",
|
||||
trailingSlash: false,
|
||||
organizationName: "nextauthjs",
|
||||
projectName: "next-auth",
|
||||
// TODO: remove this once ready
|
||||
onBrokenLinks: "log",
|
||||
projectName: "next-auth",
|
||||
themeConfig: {
|
||||
prism: {
|
||||
theme: require("prism-react-renderer/themes/nightOwl"),
|
||||
@@ -54,7 +54,7 @@ module.exports = {
|
||||
position: "left",
|
||||
},
|
||||
{
|
||||
to: "/guides/overview",
|
||||
to: "/guides",
|
||||
activeBasePath: "/guides",
|
||||
label: "Guides",
|
||||
position: "left",
|
||||
@@ -114,7 +114,7 @@ module.exports = {
|
||||
},
|
||||
{
|
||||
html: `
|
||||
<a target="_blank" rel="noopener noreferrer" href="https://vercel.com?utm_source=nextauthjs&utm_campaign=oss">
|
||||
<a target="_blank" rel="noopener noreferrer" href="https://vercel.com?utm_source=authjs&utm_campaign=oss">
|
||||
<img
|
||||
alt="Powered by Vercel"
|
||||
style="margin-top: 8px"
|
||||
@@ -182,7 +182,6 @@ module.exports = {
|
||||
remarkPlugins: [
|
||||
require("@sapphire/docusaurus-plugin-npm2yarn2pnpm").npm2yarn2pnpm,
|
||||
require("remark-github"),
|
||||
require("mdx-mermaid"),
|
||||
],
|
||||
versions: {
|
||||
current: {
|
||||
@@ -219,3 +218,77 @@ module.exports = {
|
||||
],
|
||||
],
|
||||
}
|
||||
|
||||
docusaurusConfig.headTags = [
|
||||
{
|
||||
tagName: "meta",
|
||||
attributes: {
|
||||
charSet: "utf-8",
|
||||
},
|
||||
},
|
||||
{
|
||||
tagName: "link",
|
||||
attributes: {
|
||||
rel: "canonical",
|
||||
href: docusaurusConfig.url,
|
||||
},
|
||||
},
|
||||
{
|
||||
tagName: "meta",
|
||||
attributes: {
|
||||
property: "og:title",
|
||||
content: docusaurusConfig.title,
|
||||
},
|
||||
},
|
||||
{
|
||||
tagName: "meta",
|
||||
attributes: {
|
||||
property: "og:description",
|
||||
content: docusaurusConfig.tagline,
|
||||
},
|
||||
},
|
||||
{
|
||||
tagName: "meta",
|
||||
attributes: {
|
||||
property: "og:image",
|
||||
content: `${docusaurusConfig.url}/img/og-image.png`,
|
||||
},
|
||||
},
|
||||
{
|
||||
tagName: "meta",
|
||||
attributes: {
|
||||
property: "og:url",
|
||||
content: docusaurusConfig.url,
|
||||
},
|
||||
},
|
||||
{
|
||||
tagName: "meta",
|
||||
attributes: {
|
||||
name: "twitter:card",
|
||||
content: "summary_large_image",
|
||||
},
|
||||
},
|
||||
{
|
||||
tagName: "meta",
|
||||
attributes: {
|
||||
name: "twitter:title",
|
||||
content: docusaurusConfig.title,
|
||||
},
|
||||
},
|
||||
{
|
||||
tagName: "meta",
|
||||
attributes: {
|
||||
name: "twitter:description",
|
||||
content: docusaurusConfig.tagline,
|
||||
},
|
||||
},
|
||||
{
|
||||
tagName: "meta",
|
||||
attributes: {
|
||||
name: "twitter:image",
|
||||
content: `${docusaurusConfig.url}/img/og-image.png`,
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
module.exports = docusaurusConfig
|
||||
|
||||
@@ -18,16 +18,16 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@mdx-js/react": "1.6.22",
|
||||
"@sapphire/docusaurus-plugin-npm2yarn2pnpm": "1.1.3",
|
||||
"classnames": "^2.3.1",
|
||||
"mdx-mermaid": "^1.2.2",
|
||||
"mermaid": "^9.0.1",
|
||||
"prism-react-renderer": "1.3.1",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"@sapphire/docusaurus-plugin-npm2yarn2pnpm": "1.1.4",
|
||||
"classnames": "^2.3.2",
|
||||
"mdx-mermaid": "1.2.2",
|
||||
"mermaid": "9.0.1",
|
||||
"prism-react-renderer": "1.3.5",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-marquee-slider": "^1.1.5",
|
||||
"remark-github": "^10.1.0",
|
||||
"styled-components": "5.3.3"
|
||||
"remark-github": "10.1.0",
|
||||
"styled-components": "5.3.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/core": "2.2.0",
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
// @ts-check
|
||||
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
|
||||
module.exports = {
|
||||
gettingStarted: [
|
||||
gettingStartedSidebar: [
|
||||
{
|
||||
type: "autogenerated",
|
||||
dirName: "getting-started",
|
||||
},
|
||||
],
|
||||
guides: [
|
||||
guidesSidebar: [
|
||||
{
|
||||
type: "autogenerated",
|
||||
dirName: "guides",
|
||||
},
|
||||
],
|
||||
reference: [
|
||||
referenceSidebar: [
|
||||
"reference/index",
|
||||
{
|
||||
type: "category",
|
||||
@@ -103,7 +103,7 @@ module.exports = {
|
||||
"reference/utilities/client",
|
||||
"reference/warnings",
|
||||
],
|
||||
concepts: [
|
||||
conceptsSidebar: [
|
||||
{
|
||||
type: "autogenerated",
|
||||
dirName: "concepts",
|
||||
|
||||
0
docs/snippets/.gitkeep
Normal file
0
docs/snippets/.gitkeep
Normal file
@@ -3,21 +3,21 @@ Add $1 login to your page.
|
||||
## Example
|
||||
|
||||
@example
|
||||
|
||||
```js
|
||||
import Auth from "@auth/core"
|
||||
import { $1 } from "@auth/core/providers/$2"
|
||||
|
||||
const request = new Request("https://example.com")
|
||||
const resposne = await AuthHandler(request, {
|
||||
providers: [
|
||||
$1({clientId: "", clientSecret: ""})
|
||||
]
|
||||
providers: [$1({ clientId: "", clientSecret: "" })],
|
||||
})
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Resources
|
||||
|
||||
@see [Link 1](https://example.com)
|
||||
|
||||
---
|
||||
|
||||
@@ -10,9 +10,7 @@ import { $1 } from "@auth/core/providers/$2"
|
||||
|
||||
const request = new Request("https://example.com")
|
||||
const resposne = await AuthHandler(request, {
|
||||
providers: [
|
||||
$1({clientId: "", clientSecret: ""})
|
||||
]
|
||||
providers: [$1({ clientId: "", clientSecret: "" })],
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
@@ -274,8 +274,6 @@ html[data-theme="dark"] #carbonads .carbon-poweredby {
|
||||
background: #1e2021;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
This is a hack to hide the "Reflection" category and "main" module from the sidebar.
|
||||
This is because:
|
||||
@@ -294,4 +292,4 @@ html[data-theme="dark"] #carbonads .carbon-poweredby {
|
||||
*/
|
||||
#classes, h3.anchor + p:has(code, strong) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
import * as React from "react"
|
||||
import Link from "@docusaurus/Link"
|
||||
import useBaseUrl from "@docusaurus/useBaseUrl"
|
||||
import useDocusaurusContext from "@docusaurus/useDocusaurusContext"
|
||||
import CodeBlock from "@theme/CodeBlock"
|
||||
import Layout from "@theme/Layout"
|
||||
import classnames from "classnames"
|
||||
import { useEffect } from "react"
|
||||
import ProviderMarquee from "../components/ProviderMarquee"
|
||||
import styles from "./index.module.css"
|
||||
import Seo from "./seo"
|
||||
import providers from "../../providers.json"
|
||||
import * as React from 'react'
|
||||
import Link from '@docusaurus/Link'
|
||||
import useBaseUrl from '@docusaurus/useBaseUrl'
|
||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext'
|
||||
import CodeBlock from '@theme/CodeBlock'
|
||||
import Layout from '@theme/Layout'
|
||||
import classnames from 'classnames'
|
||||
import { useEffect } from 'react'
|
||||
import ProviderMarquee from '../components/ProviderMarquee'
|
||||
import styles from './index.module.css'
|
||||
import providers from '../../providers.json'
|
||||
|
||||
const providersCount = Object.keys(providers).length + 2 // email, credentials
|
||||
const features = [
|
||||
{
|
||||
title: "Easy",
|
||||
imageUrl: "img/undraw_social.svg",
|
||||
title: 'Easy',
|
||||
imageUrl: 'img/undraw_social.svg',
|
||||
description: (
|
||||
<ul>
|
||||
<li>
|
||||
@@ -32,11 +31,11 @@ const features = [
|
||||
Use with <i>any</i> username / password store
|
||||
</li>
|
||||
</ul>
|
||||
),
|
||||
)
|
||||
},
|
||||
{
|
||||
title: "Flexible",
|
||||
imageUrl: "img/undraw_authentication.svg",
|
||||
title: 'Flexible',
|
||||
imageUrl: 'img/undraw_authentication.svg',
|
||||
description: (
|
||||
<ul>
|
||||
<li>
|
||||
@@ -56,11 +55,11 @@ const features = [
|
||||
</li>
|
||||
<li>Choose database sessions or JWT</li>
|
||||
</ul>
|
||||
),
|
||||
)
|
||||
},
|
||||
{
|
||||
title: "Secure",
|
||||
imageUrl: "img/undraw_secure.svg",
|
||||
title: 'Secure',
|
||||
imageUrl: 'img/undraw_secure.svg',
|
||||
description: (
|
||||
<ul>
|
||||
<li>Signed, prefixed, server-only cookies</li>
|
||||
@@ -69,18 +68,18 @@ const features = [
|
||||
{/* <li>Tab syncing, auto-revalidation, keepalives</li> */}
|
||||
<li>Doesn't rely on client side JavaScript</li>
|
||||
</ul>
|
||||
),
|
||||
},
|
||||
)
|
||||
}
|
||||
]
|
||||
|
||||
const kFormatter = (num) => {
|
||||
return Math.sign(num) * (Math.abs(num) / 1000).toFixed(1) + "k"
|
||||
return Math.sign(num) * (Math.abs(num) / 1000).toFixed(1) + 'k'
|
||||
}
|
||||
|
||||
function Feature({ imageUrl, title, description }) {
|
||||
function Feature ({ imageUrl, title, description }) {
|
||||
const imgUrl = useBaseUrl(imageUrl)
|
||||
return (
|
||||
<div className={classnames("col col--4", styles.feature)}>
|
||||
<div className={classnames('col col--4', styles.feature)}>
|
||||
{imgUrl && (
|
||||
<div className="text--center">
|
||||
<div className="feature-image-wrapper">
|
||||
@@ -94,29 +93,28 @@ function Feature({ imageUrl, title, description }) {
|
||||
)
|
||||
}
|
||||
|
||||
export default function Home() {
|
||||
export default function Home () {
|
||||
const context = useDocusaurusContext()
|
||||
const { siteConfig = {} } = context
|
||||
|
||||
useEffect(() => {
|
||||
window
|
||||
.fetch("https://api.github.com/repos/nextauthjs/next-auth")
|
||||
.fetch('https://api.github.com/repos/nextauthjs/next-auth')
|
||||
.then((res) => res.json())
|
||||
.then((data) => {
|
||||
const navLinks = document.getElementsByClassName(
|
||||
"navbar__item navbar__link"
|
||||
'navbar__item navbar__link'
|
||||
)
|
||||
const githubStat = document.createElement("span")
|
||||
const githubStat = document.createElement('span')
|
||||
githubStat.innerHTML = kFormatter(data.stargazers_count)
|
||||
githubStat.className = "github-counter"
|
||||
githubStat.className = 'github-counter'
|
||||
navLinks[4].appendChild(githubStat)
|
||||
})
|
||||
}, [])
|
||||
return (
|
||||
<Layout description={siteConfig.tagline}>
|
||||
<Seo />
|
||||
<div className="home-wrapper">
|
||||
<header className={classnames("hero", styles.heroBanner)}>
|
||||
<header className={classnames('hero', styles.heroBanner)}>
|
||||
<div className="container">
|
||||
<div className="hero-inner">
|
||||
<img
|
||||
@@ -131,7 +129,7 @@ export default function Home() {
|
||||
<div className={styles.buttons}>
|
||||
<a
|
||||
className={classnames(
|
||||
"button button--outline button--secondary button--lg rounded-pill",
|
||||
'button button--outline button--secondary button--lg rounded-pill',
|
||||
styles.button
|
||||
)}
|
||||
href="https://next-auth-example.vercel.app"
|
||||
@@ -140,7 +138,7 @@ export default function Home() {
|
||||
</a>
|
||||
<a
|
||||
className={classnames(
|
||||
"button button--outline button--secondary button--lg rounded-pill",
|
||||
'button button--outline button--secondary button--lg rounded-pill',
|
||||
styles.button
|
||||
)}
|
||||
href="https://sveltekit-auth-example.vercel.app"
|
||||
@@ -149,10 +147,10 @@ export default function Home() {
|
||||
</a>
|
||||
<Link
|
||||
className={classnames(
|
||||
"button button--primary button--lg rounded-pill",
|
||||
'button button--primary button--lg rounded-pill',
|
||||
styles.button
|
||||
)}
|
||||
to={useBaseUrl("/getting-started/introduction")}
|
||||
to={useBaseUrl('/getting-started/introduction')}
|
||||
>
|
||||
Get Started
|
||||
</Link>
|
||||
@@ -172,7 +170,7 @@ export default function Home() {
|
||||
<div className="row">
|
||||
<div className="col">
|
||||
<h2 className={styles.featuresTitle}>
|
||||
<span>Open Source.</span> <span>Full Stack.</span>{" "}
|
||||
<span>Open Source.</span> <span>Full Stack.</span>{' '}
|
||||
<span>Own Your Data.</span>
|
||||
</h2>
|
||||
</div>
|
||||
@@ -200,7 +198,7 @@ export default function Home() {
|
||||
</div>
|
||||
<div className="row">
|
||||
<div className="col">
|
||||
<h2 className="text--center" style={{ fontSize: "2.5rem" }}>
|
||||
<h2 className="text--center" style={{ fontSize: '2.5rem' }}>
|
||||
Add authentication in minutes!
|
||||
</h2>
|
||||
</div>
|
||||
@@ -229,7 +227,7 @@ export default function Home() {
|
||||
</div>
|
||||
<div className="row">
|
||||
<div className="col">
|
||||
<p className="text--center" style={{ marginTop: "2rem" }}>
|
||||
<p className="text--center" style={{ marginTop: '2rem' }}>
|
||||
<Link
|
||||
to="/getting-started/introduction"
|
||||
className="button button--primary button--lg rounded-pill"
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
import * as React from "react"
|
||||
import Head from "@docusaurus/Head"
|
||||
import useDocusaurusContext from "@docusaurus/useDocusaurusContext"
|
||||
|
||||
export default function Seo() {
|
||||
const context = useDocusaurusContext()
|
||||
const { siteConfig = {} } = context
|
||||
const { title, tagline, url } = siteConfig
|
||||
|
||||
return (
|
||||
<Head>
|
||||
<meta charSet="utf-8" />
|
||||
<link rel="canonical" href={url} />
|
||||
<meta property="og:title" content={title} />
|
||||
<meta property="og:description" content={tagline} />
|
||||
<meta property="og:image" content={`${url}/img/og-image.png`} />
|
||||
<meta property="og:url" content={url} />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:title" content={title} />
|
||||
<meta name="twitter:description" content={tagline} />
|
||||
<meta name="twitter:image" content={`${url}/img/og-image.png`} />
|
||||
</Head>
|
||||
)
|
||||
}
|
||||
@@ -17,12 +17,7 @@
|
||||
"JsonValue"
|
||||
],
|
||||
"readme": "none",
|
||||
"sort": [
|
||||
"kind",
|
||||
"static-first",
|
||||
"required-first",
|
||||
"alphabetical"
|
||||
],
|
||||
"sort": ["kind", "static-first", "required-first", "alphabetical"],
|
||||
"kindSortOrder": [
|
||||
"Function",
|
||||
"TypeAlias",
|
||||
@@ -47,4 +42,4 @@
|
||||
"GetSignature",
|
||||
"SetSignature"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<p align="center">
|
||||
<br/>
|
||||
<a href="https://next-auth.js.org" target="_blank"><img height="64px" src="https://next-auth.js.org/img/logo/logo-sm.png" /></a> <img height="64px" src="https://cloud.dgraph.io/logo.svg" />
|
||||
<a href="https://authjs.dev" target="_blank"><img height="64px" src="https://authjs.dev/img/logo/logo-sm.png" /></a> <img height="64px" src="https://cloud.dgraph.io/logo.svg" />
|
||||
<h3 align="center"><b>Dgraph Adapter</b> - NextAuth.js</h3>
|
||||
<p align="center">
|
||||
Open Source. Full Stack. Own Your Data.
|
||||
@@ -14,9 +14,9 @@
|
||||
|
||||
## Overview
|
||||
|
||||
This is the Dgraph Adapter for [`next-auth`](https://next-auth.js.org). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
This is the Dgraph Adapter for [`auth.js`](https://authjs.dev). This package can only be used in conjunction with the primary `auth.js` package. It is not a standalone package.
|
||||
|
||||
You can find two Graphql schemas in the [`docs`](https://next-auth.js.org/adapters/dgraph/schema.gql).
|
||||
You can find two Graphql schemas in the [`docs`](https://authjs.dev/adapters/dgraph/schema.gql).
|
||||
|
||||
1. The unsecure don't implement any auth directive is perfect for a quick start.
|
||||
2. The second one is more secure and require you replace some value before copy pasting it into your Dgraph console ([`see Securing your database`](#securing-your-database)).
|
||||
@@ -36,9 +36,9 @@ import NextAuth from "next-auth"
|
||||
import { DgraphAdapter } from "@next-auth/dgraph-adapter";
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/configuration/auth-options
|
||||
export default NextAuth({
|
||||
// https://next-auth.js.org/configuration/providers
|
||||
// https://authjs.dev/reference/providers/oauth-builtin
|
||||
providers: [
|
||||
...,
|
||||
],
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@next-auth/dgraph-adapter",
|
||||
"version": "1.0.4",
|
||||
"description": "Dgraph adapter for next-auth.",
|
||||
"homepage": "https://next-auth.js.org",
|
||||
"homepage": "https://authjs.dev",
|
||||
"repository": "https://github.com/nextauthjs/next-auth",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nextauthjs/next-auth/issues"
|
||||
@@ -50,4 +50,4 @@
|
||||
"jest": {
|
||||
"preset": "@next-auth/adapter-test/jest"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<p align="center">
|
||||
<br/>
|
||||
<a href="https://next-auth.js.org" target="_blank"><img height="64px" src="https://next-auth.js.org/img/logo/logo-sm.png" /></a> <img height="64px" src="https://raw.githubusercontent.com/nextauthjs/adapters/main/packages/dynamodb/logo.png" />
|
||||
<a href="https://authjs.dev" target="_blank"><img height="64px" src="https://authjs.dev/img/logo/logo-sm.png" /></a> <img height="64px" src="https://raw.githubusercontent.com/nextauthjs/adapters/main/packages/dynamodb/logo.png" />
|
||||
<h3 align="center"><b>DynamoDB Adapter</b> - NextAuth.js</h3>
|
||||
<p align="center">
|
||||
Open Source. Full Stack. Own Your Data.
|
||||
@@ -20,7 +20,7 @@ You need a table with a partition key `pk` and a sort key `sk`. Your table also
|
||||
|
||||
If you want sessions and verification tokens to get automatically removed from your table you need to [activate TTL](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html) on your table with the TTL attribute name set to `expires`
|
||||
|
||||
You can find the DynamoDB schema in the docs at [next-auth.js.org/adapters/dynamodb](https://next-auth.js.org/adapters/dynamodb).
|
||||
You can find the DynamoDB schema in the docs at [authjs.dev/reference/adapters/dynamodb](https://authjs.dev/reference/adapters/dynamodb).
|
||||
|
||||
## Getting Started
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"oauth",
|
||||
"dynamodb"
|
||||
],
|
||||
"homepage": "https://next-auth.js.org",
|
||||
"homepage": "https://authjs.dev",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nextauthjs/next-auth/issues"
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<p align="center">
|
||||
<br/>
|
||||
<a href="https://next-auth.js.org" target="_blank">
|
||||
<img height="64px" src="https://next-auth.js.org/img/logo/logo-sm.png" /></a> <img height="64px" src="https://raw.githubusercontent.com/nextauthjs/adapters/main/packages/fauna/logo.svg" />
|
||||
<a href="https://authjs.dev" target="_blank">
|
||||
<img height="64px" src="https://authjs.dev/img/logo/logo-sm.png" /></a> <img height="64px" src="https://raw.githubusercontent.com/nextauthjs/adapters/main/packages/fauna/logo.svg" />
|
||||
<h3 align="center"><b>Fauna Adapter</b> - NextAuth.js</h3>
|
||||
<p align="center">
|
||||
Open Source. Full Stack. Own Your Data.
|
||||
@@ -15,9 +15,9 @@
|
||||
|
||||
## Overview
|
||||
|
||||
This is the Fauna Adapter for [`next-auth`](https://next-auth.js.org). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
This is the Fauna Adapter for [`auth.js`](https://authjs.dev). This package can only be used in conjunction with the primary `auth.js` package. It is not a standalone package.
|
||||
|
||||
You can find the Fauna schema and seed information in the docs at [next-auth.js.org/adapters/fauna](https://next-auth.js.org/adapters/fauna).
|
||||
You can find the Fauna schema and seed information in the docs at [authjs.dev/reference/adapters/fauna](https://authjs.dev/reference/adapters/fauna).
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -42,9 +42,9 @@ const client = new FaunaClient({
|
||||
})
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/configuration/auth-options
|
||||
export default NextAuth({
|
||||
// https://next-auth.js.org/configuration/providers
|
||||
// https://authjs.dev/reference/providers/oauth-builtin
|
||||
providers: [],
|
||||
adapter: FaunaAdapter(client)
|
||||
...
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@next-auth/fauna-adapter",
|
||||
"version": "1.0.4",
|
||||
"description": "Fauna Adapter for NextAuth",
|
||||
"homepage": "https://next-auth.js.org",
|
||||
"homepage": "https://authjs.dev",
|
||||
"repository": "https://github.com/nextauthjs/next-auth",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nextauthjs/next-auth/issues"
|
||||
@@ -56,4 +56,4 @@
|
||||
"jest": {
|
||||
"preset": "@next-auth/adapter-test/jest"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<p align="center">
|
||||
<br/>
|
||||
<a href="https://next-auth.js.org" target="_blank">
|
||||
<img height="64px" src="https://next-auth.js.org/img/logo/logo-sm.png" /></a><img height="64px" src="https://raw.githubusercontent.com/nextauthjs/adapters/main/packages/firebase/logo.svg" />
|
||||
<a href="https://authjs.dev" target="_blank">
|
||||
<img height="64px" src="https://authjs.dev/img/logo/logo-sm.png" /></a><img height="64px" src="https://raw.githubusercontent.com/nextauthjs/adapters/main/packages/firebase/logo.svg" />
|
||||
<h3 align="center"><b>Firebase Adapter</b> - NextAuth.js</h3>
|
||||
<p align="center">
|
||||
Open Source. Full Stack. Own Your Data.
|
||||
@@ -15,9 +15,9 @@
|
||||
|
||||
## Overview
|
||||
|
||||
This is the Firebase Adapter for [`next-auth`](https://next-auth.js.org). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
This is the Firebase Adapter for [`auth.js`](https://authjs.dev). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
|
||||
You can find more Firebase information in the docs at [next-auth.js.org/adapters/firebase](https://next-auth.js.org/adapters/firebase).
|
||||
You can find more Firebase information in the docs at [authjs.dev/reference/adapters/firebase](https://authjs.dev/reference/adapters/firebase).
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -41,9 +41,9 @@ const app = initializeApp({ projectId: "next-auth-test" });
|
||||
const firestore = getFirestore(app);
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/configuration/auth-options
|
||||
export default NextAuth({
|
||||
// https://next-auth.js.org/configuration/providers
|
||||
// https://authjs.dev/reference/providers/oauth-builtin
|
||||
providers: [
|
||||
Providers.Google({
|
||||
clientId: process.env.GOOGLE_ID,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@next-auth/firebase-adapter",
|
||||
"version": "1.0.3",
|
||||
"description": "Firebase adapter for next-auth.",
|
||||
"homepage": "https://next-auth.js.org",
|
||||
"homepage": "https://authjs.dev",
|
||||
"repository": "https://github.com/nextauthjs/next-auth",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nextauthjs/next-auth/issues"
|
||||
@@ -43,4 +43,4 @@
|
||||
"jest": "^27.4.3",
|
||||
"next-auth": "workspace:*"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<p align="center">
|
||||
<br/>
|
||||
<a href="https://next-auth.js.org" target="_blank"><img height="64px" src="https://next-auth.js.org/img/logo/logo-sm.png" /></a> <img height="64px" src="https://raw.githubusercontent.com/nextauthjs/adapters/main/packages/mikro-orm/logo.svg" />
|
||||
<a href="https://authjs.dev" target="_blank"><img height="64px" src="https://authjs.dev/img/logo/logo-sm.png" /></a> <img height="64px" src="https://raw.githubusercontent.com/nextauthjs/adapters/main/packages/mikro-orm/logo.svg" />
|
||||
<h3 align="center"><b>Mikro ORM Adapter</b> - NextAuth.js</h3>
|
||||
<p align="center">
|
||||
Open Source. Full Stack. Own Your Data.
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
## Overview
|
||||
|
||||
This is the MikroORM Adapter for [`next-auth`](https://next-auth.js.org). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
This is the MikroORM Adapter for [`auth.js`](https://authjs.dev). This package can only be used in conjunction with the primary `auth.js` package. It is not a standalone package.
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -31,9 +31,9 @@ This is the MikroORM Adapter for [`next-auth`](https://next-auth.js.org). This p
|
||||
import { MikroOrmAdapter } from "@next-auth/mikro-orm-adapter"
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/configuration/auth-options
|
||||
export default NextAuth({
|
||||
// https://next-auth.js.org/configuration/providers
|
||||
// https://authjs.dev/reference/providers/oauth-builtin
|
||||
providers: [],
|
||||
adapter: MikroOrmAdapter({
|
||||
dbName: "./db.sqlite",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@next-auth/mikro-orm-adapter",
|
||||
"version": "3.0.1",
|
||||
"description": "MikroORM adapter for next-auth.",
|
||||
"homepage": "https://next-auth.js.org",
|
||||
"homepage": "https://authjs.dev",
|
||||
"repository": "https://github.com/nextauthjs/next-auth",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nextauthjs/next-auth/issues"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<p align="center">
|
||||
<br/>
|
||||
<a href="https://next-auth.js.org" target="_blank"><img height="64px" src="https://next-auth.js.org/img/logo/logo-sm.png" /></a> <img height="64px" src="./logo.svg" />
|
||||
<a href="https://authjs.dev" target="_blank"><img height="64px" src="https://authjs.dev/img/logo/logo-sm.png" /></a> <img height="64px" src="./logo.svg" />
|
||||
<h3 align="center"><b>MongoDB Adapter</b> - NextAuth.js</h3>
|
||||
<p align="center">
|
||||
Open Source. Full Stack. Own Your Data.
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
## Overview
|
||||
|
||||
This is the MongoDB Adapter for [`next-auth`](https://next-auth.js.org). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
This is the MongoDB Adapter for [`auth.js`](https://authjs.dev). This package can only be used in conjunction with the primary `auth.js` package. It is not a standalone package.
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -70,7 +70,7 @@ import { MongoDBAdapter } from "@next-auth/mongodb-adapter"
|
||||
import clientPromise from "lib/mongodb"
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/configuration/auth-options
|
||||
export default NextAuth({
|
||||
adapter: MongoDBAdapter(clientPromise, {
|
||||
databaseName: 'my-data-base-name'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@next-auth/mongodb-adapter",
|
||||
"version": "1.1.1",
|
||||
"description": "mongoDB adapter for next-auth.",
|
||||
"homepage": "https://next-auth.js.org",
|
||||
"homepage": "https://authjs.dev",
|
||||
"repository": "https://github.com/nextauthjs/next-auth",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nextauthjs/next-auth/issues"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<p align="center">
|
||||
<br/>
|
||||
<a href="https://next-auth.js.org" target="_blank"><img height="64px" src="https://next-auth.js.org/img/logo/logo-sm.png" /></a> <img height="64px" src="./logo.svg" />
|
||||
<a href="https://authjs.dev" target="_blank"><img height="64px" src="https://authjs.dev/img/logo/logo-sm.png" /></a> <img height="64px" src="./logo.svg" />
|
||||
<h3 align="center"><b>Neo4j Adapter</b> - NextAuth.js</h3>
|
||||
<p align="center">
|
||||
Open Source. Full Stack. Own Your Data.
|
||||
@@ -14,9 +14,9 @@
|
||||
|
||||
## Overview
|
||||
|
||||
This is the Neo4j Adapter for [`next-auth`](https://next-auth.js.org). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
This is the Neo4j Adapter for [`auth.js`](https://authjs.dev). This package can only be used in conjunction with the primary `auth.js` package. It is not a standalone package.
|
||||
|
||||
You can find the Neo4j schema in the docs at [next-auth.js.org/adapters/neo4j](next-auth.js.org/adapters/neo4j).
|
||||
You can find the Neo4j schema in the docs at [authjs.dev/reference/adapters/neo4j](authjs.dev/reference/adapters/neo4j).
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -41,7 +41,7 @@ const driver = neo4j.driver(
|
||||
const neo4jSession = driver.session()
|
||||
|
||||
export default NextAuth({
|
||||
// https://next-auth.js.org/configuration/providers
|
||||
// https://authjs.dev/reference/providers/oauth-builtin
|
||||
providers: [],
|
||||
adapter: Neo4jAdapter(neo4jSession),
|
||||
...
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@next-auth/neo4j-adapter",
|
||||
"version": "1.0.5",
|
||||
"description": "neo4j adapter for next-auth.",
|
||||
"homepage": "https://next-auth.js.org",
|
||||
"homepage": "https://authjs.dev",
|
||||
"repository": "https://github.com/nextauthjs/next-auth",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nextauthjs/next-auth/issues"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<p align="center">
|
||||
<br/>
|
||||
<a href="https://next-auth.js.org" target="_blank"><img height="64px" src="https://next-auth.js.org/img/logo/logo-sm.png" /></a> <img height="64px" src="https://raw.githubusercontent.com/nextauthjs/adapters/main/packages/pouchdb/logo.svg" />
|
||||
<a href="https://authjs.dev" target="_blank"><img height="64px" src="https://authjs.dev/img/logo/logo-sm.png" /></a> <img height="64px" src="https://raw.githubusercontent.com/nextauthjs/adapters/main/packages/pouchdb/logo.svg" />
|
||||
<h3 align="center"><b>PouchDB Adapter</b> - NextAuth.js</h3>
|
||||
<p align="center">
|
||||
Open Source. Full Stack. Own Your Data.
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
## Overview
|
||||
|
||||
This is the PouchDB Adapter for [`next-auth`](https://next-auth.js.org). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
This is the PouchDB Adapter for [`auth.js`](https://authjs.dev). This package can only be used in conjunction with the primary `auth.js` package. It is not a standalone package.
|
||||
|
||||
Depending on your architecture you can use PouchDB's http adapter to reach any database compliant with the CouchDB protocol (CouchDB, Cloudant, ...) or use any other PouchDB compatible adapter (leveldb, in-memory, ...)
|
||||
|
||||
@@ -43,9 +43,9 @@ PouchDB.plugin(require("pouchdb-adapter-leveldb")) // Or any other PouchDB-compl
|
||||
const pouchdb = new PouchDB("auth_db", { adapter: "leveldb" })
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/configuration/auth-options
|
||||
export default NextAuth({
|
||||
// https://next-auth.js.org/configuration/providers
|
||||
// https://authjs.dev/reference/providers/oauth-builtin
|
||||
providers: [
|
||||
Providers.Google({
|
||||
clientId: process.env.GOOGLE_ID,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@next-auth/pouchdb-adapter",
|
||||
"version": "0.1.5",
|
||||
"description": "PouchDB adapter for next-auth.",
|
||||
"homepage": "https://next-auth.js.org",
|
||||
"homepage": "https://authjs.dev",
|
||||
"repository": "https://github.com/nextauthjs/next-auth",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nextauthjs/next-auth/issues"
|
||||
@@ -51,4 +51,4 @@
|
||||
"jest": {
|
||||
"preset": "@next-auth/adapter-test/jest"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<p align="center">
|
||||
<br/>
|
||||
<a href="https://next-auth.js.org" target="_blank"><img height="64px" src="https://next-auth.js.org/img/logo/logo-sm.png" /></a> <img height="64px" src="https://raw.githubusercontent.com/nextauthjs/adapters/main/packages/prisma/logo.svg" />
|
||||
<a href="https://authjs.dev" target="_blank"><img height="64px" src="https://authjs.dev/img/logo/logo-sm.png" /></a> <img height="64px" src="https://raw.githubusercontent.com/nextauthjs/adapters/main/packages/prisma/logo.svg" />
|
||||
<h3 align="center"><b>Prisma Adapter</b> - NextAuth.js</h3>
|
||||
<p align="center">
|
||||
Open Source. Full Stack. Own Your Data.
|
||||
@@ -14,9 +14,9 @@
|
||||
|
||||
## Overview
|
||||
|
||||
This is the Prisma Adapter for [`next-auth`](https://next-auth.js.org). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
This is the Prisma Adapter for [`auth.js`](https://authjs.dev). This package can only be used in conjunction with the primary `auth.js` package. It is not a standalone package.
|
||||
|
||||
You can find the Prisma schema in the docs at [next-auth.js.org/adapters/prisma](https://next-auth.js.org/adapters/prisma).
|
||||
You can find the Prisma schema in the docs at [authjs.dev/reference/adapters/prisma](https://authjs.dev/reference/adapters/prisma).
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -37,9 +37,9 @@ import * as Prisma from "@prisma/client"
|
||||
const prisma = new Prisma.PrismaClient()
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/configuration/auth-options
|
||||
export default NextAuth({
|
||||
// https://next-auth.js.org/configuration/providers
|
||||
// https://authjs.dev/reference/providers/oauth-builtin
|
||||
providers: [],
|
||||
adapter: PrismaAdapter(prisma)
|
||||
...
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@next-auth/prisma-adapter",
|
||||
"version": "1.0.5",
|
||||
"description": "Prisma adapter for next-auth.",
|
||||
"homepage": "https://next-auth.js.org",
|
||||
"homepage": "https://authjs.dev",
|
||||
"repository": "https://github.com/nextauthjs/next-auth",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nextauthjs/next-auth/issues"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<p align="center">
|
||||
<br/>
|
||||
<a href="https://next-auth.js.org" target="_blank"><img height="64px" src="https://next-auth.js.org/img/logo/logo-sm.png" /></a> <img height="64px" src="https://raw.githubusercontent.com/nextauthjs/adapters/main/packages/sequelize/logo.svg" />
|
||||
<a href="https://authjs.dev" target="_blank"><img height="64px" src="https://authjs.dev/img/logo/logo-sm.png" /></a> <img height="64px" src="https://raw.githubusercontent.com/nextauthjs/adapters/main/packages/sequelize/logo.svg" />
|
||||
<h3 align="center"><b>Sequelize Adapter</b> - NextAuth.js</h3>
|
||||
<p align="center">
|
||||
Open Source. Full Stack. Own Your Data.
|
||||
@@ -14,9 +14,9 @@
|
||||
|
||||
## Overview
|
||||
|
||||
This is the Sequelize Adapter for [`next-auth`](https://next-auth.js.org). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
This is the Sequelize Adapter for [`auth.js`](https://authjs.dev). This package can only be used in conjunction with the primary `auth.js` package. It is not a standalone package.
|
||||
|
||||
You can find the Sequelize schema in the docs at [next-auth.js.org/adapters/sequelize](https://next-auth.js.org/adapters/sequelize).
|
||||
You can find the Sequelize schema in the docs at [authjs.dev/reference/adapters/sequelize](https://authjs.dev/reference/adapters/sequelize).
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -37,7 +37,7 @@ import Sequelize from 'sequelize'
|
||||
const sequelize = new Sequelize("sqlite::memory:")
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/configuration/auth-options
|
||||
export default NextAuth({
|
||||
...
|
||||
adapter: SequelizeAdapter(sequelize)
|
||||
@@ -47,7 +47,7 @@ export default NextAuth({
|
||||
|
||||
## Updating the database schema
|
||||
|
||||
In development, the sequelize adapter will create the necessary tables, foreign keys and indexes in your database. In production, synchronization is disabled. Best practice is to create the [required tables](https://next-auth.js.org/adapters/models) in your database via [migrations](https://sequelize.org/master/manual/migrations.html).
|
||||
In development, the sequelize adapter will create the necessary tables, foreign keys and indexes in your database. In production, synchronization is disabled. Best practice is to create the [required tables](https://authjs.dev/reference/adapters/models) in your database via [migrations](https://sequelize.org/master/manual/migrations.html).
|
||||
|
||||
In development, if you do not want the adapter to automatically create tables, you are able to pass `{ synchronize: false }` as the second option to `SequelizeAdapter` to disable this behavior:
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@next-auth/sequelize-adapter",
|
||||
"version": "1.0.7",
|
||||
"description": "Sequelize adapter for next-auth.",
|
||||
"homepage": "https://next-auth.js.org",
|
||||
"homepage": "https://authjs.dev",
|
||||
"repository": "https://github.com/nextauthjs/next-auth",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nextauthjs/next-auth/issues"
|
||||
@@ -42,4 +42,4 @@
|
||||
"jest": {
|
||||
"preset": "@next-auth/adapter-test/jest"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<p align="center">
|
||||
<br/>
|
||||
<a href="https://next-auth.js.org" target="_blank">
|
||||
<img height="64px" src="https://next-auth.js.org/img/logo/logo-sm.png" /></a><img height="64px" src="./logo.svg" />
|
||||
<a href="https://authjs.dev" target="_blank">
|
||||
<img height="64px" src="https://authjs.dev/img/logo/logo-sm.png" /></a><img height="64px" src="./logo.svg" />
|
||||
<h3 align="center"><b>Supabase Adapter</b> - NextAuth.js</h3>
|
||||
<p align="center">
|
||||
Open Source. Full Stack. Own Your Data.
|
||||
@@ -15,9 +15,9 @@
|
||||
|
||||
## Overview
|
||||
|
||||
This is the Supabase Adapter for [`next-auth`](https://next-auth.js.org). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
This is the Supabase Adapter for [`auth.js`](https://authjs.dev). This package can only be used in conjunction with the primary `auth.js` package. It is not a standalone package.
|
||||
|
||||
You can find more Supabase information in the docs at [next-auth.js.org/adapters/supabase](https://next-auth.js.org/adapters/supabase).
|
||||
You can find more Supabase information in the docs at [authjs.dev/reference/adapters/supabase](https://authjs.dev/reference/adapters/supabase).
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -34,9 +34,9 @@ import NextAuth from "next-auth"
|
||||
import { SupabaseAdapter } from "@next-auth/supabase-adapter"
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/configuration/auth-options
|
||||
export default NextAuth({
|
||||
// https://next-auth.js.org/configuration/providers
|
||||
// https://authjs.dev/reference/providers/oauth-builtin
|
||||
providers: [
|
||||
// ...
|
||||
],
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@next-auth/supabase-adapter",
|
||||
"version": "0.2.0",
|
||||
"description": "Supabase adapter for next-auth.",
|
||||
"homepage": "https://next-auth.js.org",
|
||||
"homepage": "https://authjs.dev",
|
||||
"repository": "https://github.com/nextauthjs/next-auth",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nextauthjs/next-auth/issues"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<p align="center">
|
||||
<br/>
|
||||
<a href="https://next-auth.js.org" target="_blank"><img height="64px" src="https://next-auth.js.org/img/logo/logo-sm.png" /> </a><img height="64px" src="https://raw.githubusercontent.com/nextauthjs/adapters/canary/packages/typeorm-legacy/logo.png" />
|
||||
<a href="https://authjs.dev" target="_blank"><img height="64px" src="https://authjs.dev/img/logo/logo-sm.png" /> </a><img height="64px" src="https://raw.githubusercontent.com/nextauthjs/adapters/canary/packages/typeorm-legacy/logo.png" />
|
||||
<h3 align="center"><b>TypeORM (Legacy) Adapter</b> - NextAuth.js</h3>
|
||||
<p align="center">
|
||||
Open Source. Full Stack. Own Your Data.
|
||||
@@ -14,9 +14,9 @@
|
||||
|
||||
## Overview
|
||||
|
||||
This is the TypeORM Adapter for [`next-auth`](https://next-auth.js.org). This package can only be used in conjunction with the primary `next-auth` package. It is not a standalone package.
|
||||
This is the TypeORM Adapter for [`auth.js`](https://authjs.dev). This package can only be used in conjunction with the primary `auth.js` package. It is not a standalone package.
|
||||
|
||||
You can find more TypeORM information in the docs at [next-auth.js.org/adapters/typeorm](https://next-auth.js.org/adapters/typeorm).
|
||||
You can find more TypeORM information in the docs at [authjs.dev/adapters/typeorm](https://authjs.dev/reference/adapters/typeorm).
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -33,9 +33,9 @@ import NextAuth from "next-auth"
|
||||
import { TypeORMLegacyAdapter } from "@next-auth/typeorm-legacy-adapter"
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/configuration/auth-config
|
||||
export default NextAuth({
|
||||
// https://next-auth.js.org/configuration/providers
|
||||
// https://authjs.dev/reference/providers/oauth-builtin
|
||||
providers: [],
|
||||
adapter: TypeORMLegacyAdapter({
|
||||
type: 'sqlite', // or mysql, postgresql, mssql
|
||||
@@ -54,7 +54,7 @@ export default NextAuth({
|
||||
|
||||
This adapter supports MySQL, PostgreSQL, SQLite, as well as MSSQL. Further configuration options are listed below.
|
||||
|
||||
> If you're looking for MongoDB support, it's been pulled out into its own adapter [@next-auth/mongodb-adapter](https://next-auth.js.org/adapters/mongodb).
|
||||
> If you're looking for MongoDB support, it's been pulled out into its own adapter [@next-auth/mongodb-adapter](https://authjs.dev/reference/adapters/mongodb).
|
||||
|
||||
### SQLite
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@next-auth/typeorm-legacy-adapter",
|
||||
"version": "2.0.1",
|
||||
"description": "TypeORM (legacy) adapter for next-auth.",
|
||||
"homepage": "https://next-auth.js.org",
|
||||
"homepage": "https://authjs.dev",
|
||||
"repository": "https://github.com/nextauthjs/next-auth",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nextauthjs/next-auth/issues"
|
||||
|
||||
@@ -103,7 +103,7 @@ export async function updateConnectionEntities(
|
||||
if (dataSource.options.synchronize !== false) {
|
||||
console.warn(
|
||||
"[next-auth][warn][adapter_typeorm_updating_entities]",
|
||||
"\nhttps://next-auth.js.org/warnings#adapter_typeorm_updating_entities"
|
||||
"\nhttps://authjs.dev/reference/warnings#adapter_typeorm_updating_entities"
|
||||
)
|
||||
await dataSource.synchronize()
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<p align="center">
|
||||
<br/>
|
||||
<a href="https://next-auth.js.org" target="_blank"><img height="64px" src="https://next-auth.js.org/img/logo/logo-sm.png" /></a> <img height="64px" src="logo.svg" />
|
||||
<a href="https://authjs.dev" target="_blank"><img height="64px" src="https://authjs.dev/img/logo/logo-sm.png" /></a> <img height="64px" src="logo.svg" />
|
||||
<h3 align="center"><b>Upstash Redis Adapter</b> - NextAuth.js</h3>
|
||||
<p align="center">
|
||||
Open Source. Full Stack. Own Your Data.
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
## Overview
|
||||
|
||||
This is the Upstash Redis adapter for [`next-auth`](https://next-auth.js.org). This package can only be used in conjunction with the primary `next-auth` and `@upstash/redis` packages. It is not a standalone package.
|
||||
This is the Upstash Redis adapter for [`next-auth`](https://authjs.dev). This package can only be used in conjunction with the primary `next-auth` and `@upstash/redis` packages. It is not a standalone package.
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -32,12 +32,12 @@ import { UpstashRedisAdapter } from "@next-auth/upstash-adapter"
|
||||
import { Redis } from "@upstash/redis"
|
||||
|
||||
const redis = new Redis({
|
||||
url:"UPSTASH_REDIS_REST_URL",
|
||||
url:"UPSTASH_REDIS_REST_URL",
|
||||
token:"UPSTASH_REDIS_REST_TOKEN",
|
||||
})
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
// https://authjs.dev/reference/configuration/auth-options
|
||||
export default NextAuth({
|
||||
...
|
||||
adapter: UpstashRedisAdapter(redis)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@next-auth/upstash-redis-adapter",
|
||||
"version": "3.0.3",
|
||||
"description": "Upstash adapter for next-auth. It uses Upstash's connectionless (HTTP based) Redis client.",
|
||||
"homepage": "https://next-auth.js.org",
|
||||
"homepage": "https://authjs.dev",
|
||||
"repository": "https://github.com/nextauthjs/next-auth",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nextauthjs/next-auth/issues"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<p align="center">
|
||||
<br/>
|
||||
<a href="https://next-auth.js.org" target="_blank"><img height="64px" src="https://next-auth.js.org/img/logo/logo-sm.png" /></a> <img height="64px" src="logo.svg" />
|
||||
<a href="https://authjs.dev" target="_blank"><img height="64px" src="https://authjs.dev/img/logo/logo-sm.png" /></a> <img height="64px" src="logo.svg" />
|
||||
<h3 align="center"><b>Xata Adapter</b> - NextAuth.js</h3>
|
||||
<p align="center">
|
||||
Think data, not databases.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@next-auth/xata-adapter",
|
||||
"version": "0.2.0",
|
||||
"description": "Xata adapter for next-auth.",
|
||||
"homepage": "https://next-auth.js.org",
|
||||
"homepage": "https://authjs.dev",
|
||||
"repository": "https://github.com/nextauthjs/next-auth",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nextauthjs/next-auth/issues"
|
||||
@@ -43,4 +43,4 @@
|
||||
"jest": {
|
||||
"preset": "@next-auth/adapter-test/jest"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ export interface GetTokenParams<R extends boolean = false> {
|
||||
/**
|
||||
* Takes a Auth.js request (`req`) and returns either the Auth.js issued JWT's payload,
|
||||
* or the raw JWT string. We look for the JWT in the either the cookies, or the `Authorization` header.
|
||||
* [Documentation](https://next-auth.js.org/tutorials/securing-pages-and-api-routes#using-gettoken)
|
||||
* [Documentation](https://authjs.dev/guides/basics/securing-pages-and-api-routes#using-gettoken)
|
||||
*/
|
||||
export async function getToken<R extends boolean = false>(
|
||||
params: GetTokenParams<R>
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { ErrorPageParam, Theme } from "../../types.js"
|
||||
/**
|
||||
* The following errors are passed as error query parameters to the default or overridden error page.
|
||||
*
|
||||
* [Documentation](https://next-auth.js.org/configuration/pages#error-page)
|
||||
* [Documentation](https://authjs.dev/guides/basics/pages#error-page)
|
||||
*/
|
||||
|
||||
export interface ErrorProps {
|
||||
|
||||
@@ -35,7 +35,7 @@ type RenderPageParams = {
|
||||
>
|
||||
|
||||
/**
|
||||
* Unless the user defines their [own pages](https://next-auth.js.org/configuration/pages),
|
||||
* Unless the user defines their [own pages](https://authjs.dev/guides/basics/pages),
|
||||
* we render a set of default ones, using Preact SSR.
|
||||
*/
|
||||
export default function renderPage(params: RenderPageParams) {
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
import type {
|
||||
InternalProvider,
|
||||
SignInPageErrorParam,
|
||||
Theme,
|
||||
} from "../../types.js"
|
||||
Theme
|
||||
} from '../../types.js'
|
||||
|
||||
const signinErrors: Record<
|
||||
Lowercase<SignInPageErrorParam | "default">,
|
||||
string
|
||||
Lowercase<SignInPageErrorParam | 'default'>,
|
||||
string
|
||||
> = {
|
||||
default: "Unable to sign in.",
|
||||
signin: "Try signing in with a different account.",
|
||||
oauthsignin: "Try signing in with a different account.",
|
||||
oauthcallback: "Try signing in with a different account.",
|
||||
oauthcreateaccount: "Try signing in with a different account.",
|
||||
emailcreateaccount: "Try signing in with a different account.",
|
||||
callback: "Try signing in with a different account.",
|
||||
default: 'Unable to sign in.',
|
||||
signin: 'Try signing in with a different account.',
|
||||
oauthsignin: 'Try signing in with a different account.',
|
||||
oauthcallback: 'Try signing in with a different account.',
|
||||
oauthcreateaccount: 'Try signing in with a different account.',
|
||||
emailcreateaccount: 'Try signing in with a different account.',
|
||||
callback: 'Try signing in with a different account.',
|
||||
oauthaccountnotlinked:
|
||||
"To confirm your identity, sign in with the same account you used originally.",
|
||||
emailsignin: "The e-mail could not be sent.",
|
||||
'To confirm your identity, sign in with the same account you used originally.',
|
||||
emailsignin: 'The e-mail could not be sent.',
|
||||
credentialssignin:
|
||||
"Sign in failed. Check the details you provided are correct.",
|
||||
sessionrequired: "Please sign in to access this page.",
|
||||
'Sign in failed. Check the details you provided are correct.',
|
||||
sessionrequired: 'Please sign in to access this page.'
|
||||
}
|
||||
|
||||
export default function SigninPage(props: {
|
||||
export default function SigninPage (props: {
|
||||
csrfToken: string
|
||||
providers: InternalProvider[]
|
||||
callbackUrl: string
|
||||
@@ -37,12 +37,12 @@ export default function SigninPage(props: {
|
||||
callbackUrl,
|
||||
theme,
|
||||
email,
|
||||
error: errorType,
|
||||
error: errorType
|
||||
} = props
|
||||
|
||||
if (typeof document !== "undefined" && theme.brandColor) {
|
||||
if (typeof document !== 'undefined' && theme.brandColor) {
|
||||
document.documentElement.style.setProperty(
|
||||
"--brand-color",
|
||||
'--brand-color',
|
||||
theme.brandColor
|
||||
)
|
||||
}
|
||||
@@ -52,13 +52,13 @@ export default function SigninPage(props: {
|
||||
|
||||
// TODO: move logos
|
||||
const logos =
|
||||
"https://raw.githubusercontent.com/nextauthjs/next-auth/main/packages/next-auth/provider-logos"
|
||||
'https://raw.githubusercontent.com/nextauthjs/next-auth/main/packages/next-auth/provider-logos'
|
||||
return (
|
||||
<div className="signin">
|
||||
{theme.brandColor && (
|
||||
<style
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `:root {--brand-color: ${theme.brandColor}}`,
|
||||
__html: `:root {--brand-color: ${theme.brandColor}}`
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
@@ -71,7 +71,8 @@ export default function SigninPage(props: {
|
||||
)}
|
||||
{providers.map((provider, i) => (
|
||||
<div key={provider.id} className="provider">
|
||||
{provider.type === "oauth" || provider.type === "oidc" ? (
|
||||
{provider.type === 'oauth' || provider.type === 'oidc'
|
||||
? (
|
||||
<form action={provider.signinUrl} method="POST">
|
||||
<input type="hidden" name="csrfToken" value={csrfToken} />
|
||||
{callbackUrl && (
|
||||
@@ -81,17 +82,17 @@ export default function SigninPage(props: {
|
||||
type="submit"
|
||||
className="button"
|
||||
style={{
|
||||
"--provider-bg": provider.style?.bg ?? "",
|
||||
"--provider-dark-bg": provider.style?.bgDark ?? "",
|
||||
"--provider-color": provider.style?.text ?? "",
|
||||
"--provider-dark-color": provider.style?.textDark ?? "",
|
||||
'--provider-bg': provider.style?.bg ?? '',
|
||||
'--provider-dark-bg': provider.style?.bgDark ?? '',
|
||||
'--provider-color': provider.style?.text ?? '',
|
||||
'--provider-dark-color': provider.style?.textDark ?? ''
|
||||
}}
|
||||
>
|
||||
{provider.style?.logo && (
|
||||
<img
|
||||
id="provider-logo"
|
||||
src={`${
|
||||
provider.style.logo.startsWith("/") ? logos : ""
|
||||
provider.style.logo.startsWith('/') ? logos : ''
|
||||
}${provider.style.logo}`}
|
||||
/>
|
||||
)}
|
||||
@@ -99,19 +100,20 @@ export default function SigninPage(props: {
|
||||
<img
|
||||
id="provider-logo-dark"
|
||||
src={`${
|
||||
provider.style.logo.startsWith("/") ? logos : ""
|
||||
provider.style.logo.startsWith('/') ? logos : ''
|
||||
}${provider.style.logoDark}`}
|
||||
/>
|
||||
)}
|
||||
<span>Sign in with {provider.name}</span>
|
||||
</button>
|
||||
</form>
|
||||
) : null}
|
||||
{(provider.type === "email" || provider.type === "credentials") &&
|
||||
)
|
||||
: null}
|
||||
{(provider.type === 'email' || provider.type === 'credentials') &&
|
||||
i > 0 &&
|
||||
providers[i - 1].type !== "email" &&
|
||||
providers[i - 1].type !== "credentials" && <hr />}
|
||||
{provider.type === "email" && (
|
||||
providers[i - 1].type !== 'email' &&
|
||||
providers[i - 1].type !== 'credentials' && <hr />}
|
||||
{provider.type === 'email' && (
|
||||
<form action={provider.signinUrl} method="POST">
|
||||
<input type="hidden" name="csrfToken" value={csrfToken} />
|
||||
<label
|
||||
@@ -132,7 +134,7 @@ export default function SigninPage(props: {
|
||||
<button type="submit">Sign in with {provider.name}</button>
|
||||
</form>
|
||||
)}
|
||||
{provider.type === "credentials" && (
|
||||
{provider.type === 'credentials' && (
|
||||
<form action={provider.callbackUrl} method="POST">
|
||||
<input type="hidden" name="csrfToken" value={csrfToken} />
|
||||
{Object.keys(provider.credentials).map((credential) => {
|
||||
@@ -147,9 +149,9 @@ export default function SigninPage(props: {
|
||||
<input
|
||||
name={credential}
|
||||
id={`input-${credential}-for-${provider.id}-provider`}
|
||||
type={provider.credentials[credential].type ?? "text"}
|
||||
type={provider.credentials[credential].type ?? 'text'}
|
||||
placeholder={
|
||||
provider.credentials[credential].placeholder ?? ""
|
||||
provider.credentials[credential].placeholder ?? ''
|
||||
}
|
||||
{...provider.credentials[credential]}
|
||||
/>
|
||||
@@ -159,7 +161,7 @@ export default function SigninPage(props: {
|
||||
<button type="submit">Sign in with {provider.name}</button>
|
||||
</form>
|
||||
)}
|
||||
{(provider.type === "email" || provider.type === "credentials") &&
|
||||
{(provider.type === 'email' || provider.type === 'credentials') &&
|
||||
i + 1 < providers.length && <hr />}
|
||||
</div>
|
||||
))}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { AuthError } from "../../errors.js"
|
||||
import { AuthError } from '../../errors.js'
|
||||
|
||||
export type WarningCode = "debug_enabled"
|
||||
export type WarningCode = 'debug_enabled'
|
||||
|
||||
/**
|
||||
* Override any of the methods, and the rest will use the default logger.
|
||||
*
|
||||
* [Documentation](https://authjs.dev/configuration/options#logger)
|
||||
* [Documentation](https://authjs.dev/reference/configuration/auth-config#logger)
|
||||
*/
|
||||
export interface LoggerInstance extends Record<string, Function> {
|
||||
warn: (code: WarningCode) => void
|
||||
@@ -13,13 +13,13 @@ export interface LoggerInstance extends Record<string, Function> {
|
||||
debug: (message: string, metadata?: unknown) => void
|
||||
}
|
||||
|
||||
const red = "\x1b[31m"
|
||||
const yellow = "\x1b[33m"
|
||||
const grey = "\x1b[90m"
|
||||
const reset = "\x1b[0m"
|
||||
const red = '\x1b[31m'
|
||||
const yellow = '\x1b[33m'
|
||||
const grey = '\x1b[90m'
|
||||
const reset = '\x1b[0m'
|
||||
|
||||
export const logger: LoggerInstance = {
|
||||
error(error: AuthError) {
|
||||
error (error: AuthError) {
|
||||
const url = `https://errors.authjs.dev#${error.name.toLowerCase()}`
|
||||
console.error(error.stack)
|
||||
console.error(
|
||||
@@ -27,23 +27,23 @@ export const logger: LoggerInstance = {
|
||||
)
|
||||
error.metadata && console.error(JSON.stringify(error.metadata, null, 2))
|
||||
},
|
||||
warn(code) {
|
||||
warn (code) {
|
||||
const url = `https://errors.authjs.dev#${code}`
|
||||
console.warn(`${yellow}[auth][warn][${code}]${reset}`, `Read more: ${url}`)
|
||||
},
|
||||
debug(message, metadata) {
|
||||
debug (message, metadata) {
|
||||
console.log(
|
||||
`${grey}[auth][debug]:${reset} ${message}`,
|
||||
JSON.stringify(metadata, null, 2)
|
||||
)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Override the built-in logger with user's implementation.
|
||||
* Any `undefined` level will use the default logger.
|
||||
*/
|
||||
export function setLogger(
|
||||
export function setLogger (
|
||||
newLogger: Partial<LoggerInstance> = {},
|
||||
debug?: boolean
|
||||
) {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* ...
|
||||
* ```
|
||||
* *Resources:*
|
||||
* - [NextAuth.js Documentation](https://next-auth.js.org/providers/dropbox)
|
||||
* - [NextAuth.js Documentation](https://authjs.dev/reference/oauth-providers/dropbox)
|
||||
* - [Dropbox Documentation](https://developers.dropbox.com/oauth-guide)
|
||||
* - [Configuration](https://www.dropbox.com/developers/apps)
|
||||
*/
|
||||
|
||||
@@ -39,7 +39,7 @@ export interface EmailConfig extends CommonProviderOptions {
|
||||
* @default 86400
|
||||
*/
|
||||
maxAge?: number
|
||||
/** [Documentation](https://next-auth.js.org/providers/email#customizing-emails) */
|
||||
/** [Documentation](https://authjs.dev/reference/providers/email#customizing-emails) */
|
||||
sendVerificationRequest: (
|
||||
params: SendVerificationRequestParams
|
||||
) => Awaitable<void>
|
||||
@@ -55,7 +55,7 @@ export interface EmailConfig extends CommonProviderOptions {
|
||||
* }
|
||||
* })
|
||||
* ```
|
||||
* [Documentation](https://next-auth.js.org/providers/email#customizing-the-verification-token)
|
||||
* [Documentation](https://authjs.dev/reference/providers/email#customizing-the-verification-token)
|
||||
*/
|
||||
generateVerificationToken?: () => Awaitable<string>
|
||||
/** If defined, it is used to hash the verification token when saving to the database . */
|
||||
@@ -72,7 +72,7 @@ export interface EmailConfig extends CommonProviderOptions {
|
||||
* By default, we treat email addresses as all lower case,
|
||||
* but you can override this function to change this behavior.
|
||||
*
|
||||
* [Documentation](https://next-auth.js.org/providers/email#normalizing-the-e-mail-address) | [RFC 2821](https://tools.ietf.org/html/rfc2821) | [Email syntax](https://en.wikipedia.org/wiki/Email_address#Syntax)
|
||||
* [Documentation](https://authjs.dev/reference/providers/email#normalizing-the-e-mail-address) | [RFC 2821](https://tools.ietf.org/html/rfc2821) | [Email syntax](https://en.wikipedia.org/wiki/Email_address#Syntax)
|
||||
*/
|
||||
normalizeIdentifier?: (identifier: string) => string
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* </button>
|
||||
* ...
|
||||
* ```
|
||||
* [NextAuth.js Documentation](https://next-auth.js.org/providers/instagram) | [Instagram Documentation](https://developers.facebook.com/docs/instagram-basic-display-api/getting-started) | [Configuration](https://developers.facebook.com/apps)
|
||||
* [NextAuth.js Documentation](https://authjs.dev/reference/providers/instagram) | [Instagram Documentation](https://developers.facebook.com/docs/instagram-basic-display-api/getting-started) | [Configuration](https://developers.facebook.com/apps)
|
||||
*/
|
||||
/** @type {import(".").OAuthProvider} */
|
||||
export default function Instagram(options) {
|
||||
|
||||
@@ -134,7 +134,7 @@ export interface OAuth2Config<P> extends CommonProviderOptions, PartialIssuer {
|
||||
* This will be used to create the user in the database.
|
||||
* Defaults to: `id`, `email`, `name`, `image`
|
||||
*
|
||||
* [Documentation](https://next-auth.js.org/adapters/models#user)
|
||||
* [Documentation](https://authjs.dev/reference/adapters/models#user)
|
||||
*/
|
||||
profile?: ProfileCallback<P>
|
||||
/**
|
||||
@@ -151,7 +151,7 @@ export interface OAuth2Config<P> extends CommonProviderOptions, PartialIssuer {
|
||||
client?: Partial<Client>
|
||||
style?: OAuthProviderButtonStyles
|
||||
/**
|
||||
* [Documentation](https://next-auth.js.org/configuration/providers/oauth#allowdangerousemailaccountlinking-option)
|
||||
* [Documentation](https://authjs.dev/reference/providers/oauth#allowdangerousemailaccountlinking-option)
|
||||
*/
|
||||
allowDangerousEmailAccountLinking?: boolean
|
||||
/**
|
||||
|
||||
@@ -55,35 +55,35 @@
|
||||
* @module types
|
||||
*/
|
||||
|
||||
import type { CookieSerializeOptions } from "cookie"
|
||||
import type { CookieSerializeOptions } from 'cookie'
|
||||
import type {
|
||||
OAuth2TokenEndpointResponse,
|
||||
OpenIDTokenEndpointResponse,
|
||||
} from "oauth4webapi"
|
||||
import type { Adapter, AdapterUser } from "./adapters.js"
|
||||
OpenIDTokenEndpointResponse
|
||||
} from 'oauth4webapi'
|
||||
import type { Adapter, AdapterUser } from './adapters.js'
|
||||
import type {
|
||||
CredentialInput,
|
||||
CredentialsConfig,
|
||||
EmailConfig,
|
||||
OAuthConfigInternal,
|
||||
ProviderType,
|
||||
} from "./providers/index.js"
|
||||
import type { JWT, JWTOptions } from "./jwt.js"
|
||||
import type { Cookie } from "./lib/cookie.js"
|
||||
import type { LoggerInstance } from "./lib/utils/logger.js"
|
||||
ProviderType
|
||||
} from './providers/index.js'
|
||||
import type { JWT, JWTOptions } from './jwt.js'
|
||||
import type { Cookie } from './lib/cookie.js'
|
||||
import type { LoggerInstance } from './lib/utils/logger.js'
|
||||
|
||||
export type { AuthConfig } from "./index.js"
|
||||
export type { AuthConfig } from './index.js'
|
||||
export type Awaitable<T> = T | PromiseLike<T>
|
||||
export type { LoggerInstance }
|
||||
|
||||
/**
|
||||
* Change the theme of the built-in pages.
|
||||
*
|
||||
* [Documentation](https://next-auth.js.org/configuration/options#theme) |
|
||||
* [Pages](https://next-auth.js.org/configuration/pages)
|
||||
* [Documentation](https://authjs.dev/reference/configuration/auth-config#theme) |
|
||||
* [Pages](https://authjs.dev/guides/basics/pages)
|
||||
*/
|
||||
export interface Theme {
|
||||
colorScheme?: "auto" | "dark" | "light"
|
||||
colorScheme?: 'auto' | 'dark' | 'light'
|
||||
logo?: string
|
||||
brandColor?: string
|
||||
buttonText?: string
|
||||
@@ -95,7 +95,7 @@ export interface Theme {
|
||||
* but they refer to the same value.
|
||||
*/
|
||||
export type TokenSet = Partial<
|
||||
OAuth2TokenEndpointResponse | OpenIDTokenEndpointResponse
|
||||
OAuth2TokenEndpointResponse | OpenIDTokenEndpointResponse
|
||||
>
|
||||
|
||||
/**
|
||||
@@ -126,7 +126,7 @@ export interface Profile {
|
||||
image?: string
|
||||
}
|
||||
|
||||
/** [Documentation](https://next-auth.js.org/configuration/callbacks) */
|
||||
/** [Documentation](https://authjs.dev/guides/basics/callbacks) */
|
||||
export interface CallbacksOptions<P = Profile, A = Account> {
|
||||
/**
|
||||
* Control whether a user is allowed to sign in or not.
|
||||
@@ -168,7 +168,7 @@ export interface CallbacksOptions<P = Profile, A = Account> {
|
||||
* By default only URLs on the same URL as the site are allowed,
|
||||
* you can use this callback to customise that behaviour.
|
||||
*
|
||||
* [Documentation](https://next-auth.js.org/configuration/callbacks#redirect-callback)
|
||||
* [Documentation](https://authjs.dev/guides/basics/callbacks#redirect-callback)
|
||||
*/
|
||||
redirect: (params: {
|
||||
/** URL provided as callback URL by the client */
|
||||
@@ -186,10 +186,10 @@ export interface CallbacksOptions<P = Profile, A = Account> {
|
||||
* If you want to make something available you added to the token through the `jwt` callback,
|
||||
* you have to explicitly forward it here to make it available to the client.
|
||||
*
|
||||
* [Documentation](https://next-auth.js.org/configuration/callbacks#session-callback) |
|
||||
* [`jwt` callback](https://next-auth.js.org/configuration/callbacks#jwt-callback) |
|
||||
* [`useSession`](https://next-auth.js.org/getting-started/client#usesession) |
|
||||
* [`getSession`](https://next-auth.js.org/getting-started/client#getsession) |
|
||||
* [Documentation](https://authjs.dev/guides/basics/callbacks#session-callback) |
|
||||
* [`jwt` callback](https://authjs.dev/guides/basics/callbacks#jwt-callback) |
|
||||
* [`useSession`](https://authjs.dev/reference/react/#usesession) |
|
||||
* [`getSession`](https://authjs.dev/reference/utilities/#getsession) |
|
||||
*
|
||||
*/
|
||||
session: (params: {
|
||||
@@ -206,8 +206,8 @@ export interface CallbacksOptions<P = Profile, A = Account> {
|
||||
*
|
||||
* ⚠ By default the JWT is signed, but not encrypted.
|
||||
*
|
||||
* [Documentation](https://next-auth.js.org/configuration/callbacks#jwt-callback) |
|
||||
* [`session` callback](https://next-auth.js.org/configuration/callbacks#session-callback)
|
||||
* [Documentation](https://authjs.dev/guides/basics/callbacks#jwt-callback) |
|
||||
* [`session` callback](https://authjs.dev/guides/basics/callbacks#session-callback)
|
||||
*/
|
||||
jwt: (params: {
|
||||
token: JWT
|
||||
@@ -218,13 +218,13 @@ export interface CallbacksOptions<P = Profile, A = Account> {
|
||||
}) => Awaitable<JWT>
|
||||
}
|
||||
|
||||
/** [Documentation](https://next-auth.js.org/configuration/options#cookies) */
|
||||
/** [Documentation](https://authjs.dev/reference/configuration/auth-config#cookies) */
|
||||
export interface CookieOption {
|
||||
name: string
|
||||
options: CookieSerializeOptions
|
||||
}
|
||||
|
||||
/** [Documentation](https://next-auth.js.org/configuration/options#cookies) */
|
||||
/** [Documentation](https://authjs.dev/reference/configuration/auth-config#cookies) */
|
||||
export interface CookiesOptions {
|
||||
sessionToken: CookieOption
|
||||
callbackUrl: CookieOption
|
||||
@@ -237,7 +237,7 @@ export interface CookiesOptions {
|
||||
/**
|
||||
* The various event callbacks you can register for from next-auth
|
||||
*
|
||||
* [Documentation](https://next-auth.js.org/configuration/events)
|
||||
* [Documentation](https://authjs.dev/guides/basics/events)
|
||||
*/
|
||||
export interface EventCallbacks {
|
||||
/**
|
||||
@@ -260,8 +260,8 @@ export interface EventCallbacks {
|
||||
*/
|
||||
signOut: (
|
||||
message:
|
||||
| { session: Awaited<ReturnType<Adapter["deleteSession"]>> }
|
||||
| { token: Awaited<ReturnType<JWTOptions["decode"]>> }
|
||||
| { session: Awaited<ReturnType<Adapter['deleteSession']>> }
|
||||
| { token: Awaited<ReturnType<JWTOptions['decode']>> }
|
||||
) => Awaitable<void>
|
||||
createUser: (message: { user: User }) => Awaitable<void>
|
||||
updateUser: (message: { user: User }) => Awaitable<void>
|
||||
@@ -276,26 +276,26 @@ export interface EventCallbacks {
|
||||
* - `token`: The JWT token for this session.
|
||||
* - `session`: The session object from your adapter.
|
||||
*/
|
||||
session: (message: { session: Session; token: JWT }) => Awaitable<void>
|
||||
session: (message: { session: Session, token: JWT }) => Awaitable<void>
|
||||
}
|
||||
|
||||
export type EventType = keyof EventCallbacks
|
||||
|
||||
/** TODO: Check if all these are used/correct */
|
||||
export type ErrorPageParam = "Configuration" | "AccessDenied" | "Verification"
|
||||
export type ErrorPageParam = 'Configuration' | 'AccessDenied' | 'Verification'
|
||||
|
||||
/** TODO: Check if all these are used/correct */
|
||||
export type SignInPageErrorParam =
|
||||
| "Signin"
|
||||
| "OAuthSignin"
|
||||
| "OAuthCallback"
|
||||
| "OAuthCreateAccount"
|
||||
| "EmailCreateAccount"
|
||||
| "Callback"
|
||||
| "OAuthAccountNotLinked"
|
||||
| "EmailSignin"
|
||||
| "CredentialsSignin"
|
||||
| "SessionRequired"
|
||||
| 'Signin'
|
||||
| 'OAuthSignin'
|
||||
| 'OAuthCallback'
|
||||
| 'OAuthCreateAccount'
|
||||
| 'EmailCreateAccount'
|
||||
| 'Callback'
|
||||
| 'OAuthAccountNotLinked'
|
||||
| 'EmailSignin'
|
||||
| 'CredentialsSignin'
|
||||
| 'SessionRequired'
|
||||
|
||||
export interface PagesOptions {
|
||||
/**
|
||||
@@ -337,16 +337,16 @@ export interface DefaultSession {
|
||||
* Returned by `useSession`, `getSession`, returned by the `session` callback
|
||||
* and also the shape received as a prop on the `SessionProvider` React Context
|
||||
*
|
||||
* [`useSession`](https://next-auth.js.org/getting-started/client#usesession) |
|
||||
* [`getSession`](https://next-auth.js.org/getting-started/client#getsession) |
|
||||
* [`SessionProvider`](https://next-auth.js.org/getting-started/client#sessionprovider) |
|
||||
* [`session` callback](https://next-auth.js.org/configuration/callbacks#jwt-callback)
|
||||
* [`useSession`](https://authjs.dev/reference/react/#usesession) |
|
||||
* [`getSession`](https://authjs.dev/reference/utilities#getsession) |
|
||||
* [`SessionProvider`](https://authjs.dev/reference/react#sessionprovider) |
|
||||
* [`session` callback](https://authjs.dev/guides/basics/callbacks#jwt-callback)
|
||||
*/
|
||||
export interface Session extends DefaultSession {}
|
||||
|
||||
export type SessionStrategy = "jwt" | "database"
|
||||
export type SessionStrategy = 'jwt' | 'database'
|
||||
|
||||
/** [Documentation](https://next-auth.js.org/configuration/options#session) */
|
||||
/** [Documentation](https://authjs.dev/reference/configuration/auth-config#session) */
|
||||
export interface SessionOptions {
|
||||
/**
|
||||
* Choose how you want to save the user session.
|
||||
@@ -358,7 +358,7 @@ export interface SessionOptions {
|
||||
* When using `"database"`, the session cookie will only contain a `sessionToken` value,
|
||||
* which is used to look up the session in the database.
|
||||
*
|
||||
* [Documentation](https://next-auth.js.org/configuration/options#session) | [Adapter](https://next-auth.js.org/configuration/options#adapter) | [About JSON Web Tokens](https://next-auth.js.org/faq#json-web-tokens)
|
||||
* [Documentation](https://authjs.dev/reference/configuration/auth-config#session) | [Adapter](https://authjs.dev/reference/configuration/auth-config#adapter) | [About JSON Web Tokens](https://authjs.dev/reference/faq#json-web-tokens)
|
||||
*/
|
||||
strategy: SessionStrategy
|
||||
/**
|
||||
@@ -396,41 +396,41 @@ export interface DefaultUser {
|
||||
* available in the `jwt` and `session` callbacks,
|
||||
* or the second parameter of the `session` callback, when using a database.
|
||||
*
|
||||
* [`signIn` callback](https://next-auth.js.org/configuration/callbacks#sign-in-callback) |
|
||||
* [`session` callback](https://next-auth.js.org/configuration/callbacks#jwt-callback) |
|
||||
* [`jwt` callback](https://next-auth.js.org/configuration/callbacks#jwt-callback) |
|
||||
* [`profile` OAuth provider callback](https://next-auth.js.org/configuration/providers#using-a-custom-provider)
|
||||
* [`signIn` callback](https://authjs.dev/guides/basics/callbacks#sign-in-callback) |
|
||||
* [`session` callback](https://authjs.dev/guides/basics/callbacks#jwt-callback) |
|
||||
* [`jwt` callback](https://authjs.dev/guides/basics/callbacks#jwt-callback) |
|
||||
* [`profile` OAuth provider callback](https://authjs.dev/guides/providers/custom-provider)
|
||||
*/
|
||||
export interface User extends DefaultUser {}
|
||||
|
||||
// Below are types that are only supposed be used by next-auth internally
|
||||
|
||||
/** @internal */
|
||||
export type InternalProvider<T = ProviderType> = (T extends "oauth"
|
||||
export type InternalProvider<T = ProviderType> = (T extends 'oauth'
|
||||
? OAuthConfigInternal<any>
|
||||
: T extends "email"
|
||||
? EmailConfig
|
||||
: T extends "credentials"
|
||||
? CredentialsConfig
|
||||
: never) & {
|
||||
signinUrl: string
|
||||
callbackUrl: string
|
||||
}
|
||||
: T extends 'email'
|
||||
? EmailConfig
|
||||
: T extends 'credentials'
|
||||
? CredentialsConfig
|
||||
: never) & {
|
||||
signinUrl: string
|
||||
callbackUrl: string
|
||||
}
|
||||
|
||||
export type AuthAction =
|
||||
| "providers"
|
||||
| "session"
|
||||
| "csrf"
|
||||
| "signin"
|
||||
| "signout"
|
||||
| "callback"
|
||||
| "verify-request"
|
||||
| "error"
|
||||
| 'providers'
|
||||
| 'session'
|
||||
| 'csrf'
|
||||
| 'signin'
|
||||
| 'signout'
|
||||
| 'callback'
|
||||
| 'verify-request'
|
||||
| 'error'
|
||||
|
||||
/** @internal */
|
||||
export interface RequestInternal {
|
||||
url: URL
|
||||
method: "GET" | "POST"
|
||||
method: 'GET' | 'POST'
|
||||
cookies?: Partial<Record<string, string>>
|
||||
headers?: Record<string, any>
|
||||
query?: Record<string, any>
|
||||
|
||||
@@ -14,7 +14,7 @@ import type {
|
||||
* or send the user to the signin page listing all possible providers.
|
||||
* Automatically adds the CSRF token to the request.
|
||||
*
|
||||
* [Documentation](https://next-auth.js.org/getting-started/client#signin)
|
||||
* [Documentation](https://authjs.dev/reference/utilities/#signin)
|
||||
*/
|
||||
export async function signIn<
|
||||
P extends RedirectableProviderType | undefined = undefined
|
||||
@@ -78,7 +78,7 @@ export async function signIn<
|
||||
* Signs the user out, by removing the session cookie.
|
||||
* Automatically adds the CSRF token to the request.
|
||||
*
|
||||
* [Documentation](https://next-auth.js.org/getting-started/client#signout)
|
||||
* [Documentation](https://authjs.dev/reference/utilities/#signout)
|
||||
*/
|
||||
export async function signOut(options?: SignOutParams) {
|
||||
const { callbackUrl = window.location.href } = options ?? {}
|
||||
|
||||
458
pnpm-lock.yaml
generated
458
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user