diff --git a/docs/docs/configuration/initialization.md b/docs/docs/configuration/initialization.md index 8a6b3eaa13..47f5123dc8 100644 --- a/docs/docs/configuration/initialization.md +++ b/docs/docs/configuration/initialization.md @@ -5,7 +5,6 @@ title: Initialization The main entry point of NextAuth.js is the `NextAuth` method that you import from `next-auth`. It handles different types of requests, as defined in the [REST API](../getting-started/rest-api.md) section. - :::info NextAuth.js cannot use the run [Edge Runtime](https://nextjs.org/docs/api-reference/edge-runtime) for initialization. The upcoming [`@auth/nextjs` library](https://authjs.dev/reference/nextjs) (which will replace `next-auth`) on the other hand will be fully compatible. ::: @@ -13,6 +12,7 @@ NextAuth.js cannot use the run [Edge Runtime](https://nextjs.org/docs/api-refere You can initialize NextAuth.js in a few different ways. ## Simple initialization + ### API Routes (`pages`) In Next.js, you can define an API route that will catch all requests that begin with a certain path. Conveniently, this is called [Catch all API routes](https://nextjs.org/docs/api-routes/dynamic-api-routes#catch-all-api-routes). @@ -62,7 +62,6 @@ Instead, `NextAuth` will receive the first two arguments of a Route Handler, and If you have a specific use case and need to make NextAuth.js do something slightly different than what it is designed for, keep in mind, the `[...nextauth].ts` config file is just **a regular [API Route](https://nextjs.org/docs/api-routes/introduction)**. - That said, you can initialize NextAuth.js like this: ```ts title="/pages/api/auth/[...nextauth].ts" @@ -148,7 +147,7 @@ export default async function auth(req, res) { } ``` -For more details on all available actions and which methods are supported, please check out the [REST API documentation](/getting-started/rest-api) or the appropriate area in [the source code](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/core/index.ts) +For more details on all available actions and which methods are supported, please check out the [REST API documentation](/getting-started/rest-api) or the appropriate area in [the source code](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/core/index.ts) This way of initializing `NextAuth` is very powerful, but should be used sparingly. diff --git a/docs/docs/configuration/pages.md b/docs/docs/configuration/pages.md index b84a794b10..74d76cfa9f 100644 --- a/docs/docs/configuration/pages.md +++ b/docs/docs/configuration/pages.md @@ -44,11 +44,11 @@ Example: `/auth/error?error=Configuration` The following errors are passed as error query parameters to the default or overridden sign-in page: -- **OAuthSignin**: Error in constructing an authorization URL ([1](https://github.com/nextauthjs/next-auth/blob/457952bb5abf08b09861b0e5da403080cd5525be/src/server/lib/signin/oauth.js), [2](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/core/lib/oauth/pkce-handler.ts), [3](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/core/lib/oauth/state-handler.ts)), -- **OAuthCallback**: Error in handling the response ([1](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/core/lib/oauth/callback.ts), [2](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/core/lib/oauth/pkce-handler.ts), [3](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/core/lib/oauth/state-handler.ts)) from an OAuth provider. +- **OAuthSignin**: Error in constructing an authorization URL ([1](https://github.com/nextauthjs/next-auth/blob/457952bb5abf08b09861b0e5da403080cd5525be/src/server/lib/signin/oauth.js), [2](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/core/lib/oauth/pkce-handler.ts), [3](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/core/lib/oauth/state-handler.ts)), +- **OAuthCallback**: Error in handling the response ([1](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/core/lib/oauth/callback.ts), [2](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/core/lib/oauth/pkce-handler.ts), [3](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/core/lib/oauth/state-handler.ts)) from an OAuth provider. - **OAuthCreateAccount**: Could not create OAuth provider user in the database. - **EmailCreateAccount**: Could not create email provider user in the database. -- **Callback**: Error in the [OAuth callback handler route](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/core/routes/callback.ts) +- **Callback**: Error in the [OAuth callback handler route](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/core/routes/callback.ts) - **OAuthAccountNotLinked**: If the email on the account is already linked, but not with this OAuth account - **EmailSignin**: Sending the e-mail with the verification token failed - **CredentialsSignin**: The `authorize` callback returned `null` in the [Credentials provider](/providers/credentials). We don't recommend providing information about which part of the credentials were wrong, as it might be abused by malicious hackers. @@ -78,12 +78,17 @@ In addition, you can define a `theme.brandColor` to define a custom accent color In order to get the available authentication providers and the URLs to use for them, you can make a request to the API endpoint `/api/auth/providers`: ```tsx title="pages/auth/signin.tsx" -import type { GetServerSidePropsContext, InferGetServerSidePropsType } from "next"; +import type { + GetServerSidePropsContext, + InferGetServerSidePropsType, +} from "next" import { getProviders, signIn } from "next-auth/react" import { getServerSession } from "next-auth/next" -import { authOptions } from "../api/auth/[...nextauth]"; +import { authOptions } from "../api/auth/[...nextauth]" -export default function SignIn({ providers }: InferGetServerSidePropsType) { +export default function SignIn({ + providers, +}: InferGetServerSidePropsType) { return ( <> {Object.values(providers).map((provider) => ( @@ -98,17 +103,17 @@ export default function SignIn({ providers }: InferGetServerSidePropsType) { +export default function SignIn({ + csrfToken, +}: InferGetServerSidePropsType) { return (
@@ -157,10 +167,15 @@ signIn("email", { email: "jsmith@example.com" }) If you create a sign in form for credentials based authentication, you will need to pass a **csrfToken** from **/api/auth/csrf** in a POST request to **/api/auth/callback/credentials**. ```tsx title="pages/auth/credentials-signin.tsx" -import type { GetServerSidePropsContext, InferGetServerSidePropsType } from "next"; +import type { + GetServerSidePropsContext, + InferGetServerSidePropsType, +} from "next" import { getCsrfToken } from "next-auth/react" -export default function SignIn({ csrfToken }: InferGetServerSidePropsType) { +export default function SignIn({ + csrfToken, +}: InferGetServerSidePropsType) { return ( diff --git a/docs/docs/configuration/providers/oauth.md b/docs/docs/configuration/providers/oauth.md index 839e559dd1..96cfad679c 100644 --- a/docs/docs/configuration/providers/oauth.md +++ b/docs/docs/configuration/providers/oauth.md @@ -359,7 +359,7 @@ providers: [ ## Built-in providers -NextAuth.js comes with a set of built-in providers. You can find them [here](https://github.com/nextauthjs/next-auth/tree/main/packages/next-auth/src/providers). Each built-in provider has its own documentation page: +NextAuth.js comes with a set of built-in providers. You can find them [here](https://github.com/nextauthjs/next-auth/tree/v4/packages/next-auth/src/providers). Each built-in provider has its own documentation page:
{Object.entries(require("../../../providers.json")) diff --git a/docs/docs/getting-started/client.md b/docs/docs/getting-started/client.md index 9bd648b370..584868a600 100644 --- a/docs/docs/getting-started/client.md +++ b/docs/docs/getting-started/client.md @@ -172,18 +172,14 @@ export default function Page() { return ( <>

Signed in as {session.user.name}

- + {/* Update the value by sending it to the backend. */} - + {/* - * Only trigger a session update, assuming you already updated the value server-side. - * All `useSession().data` references will be updated. - */} - + * Only trigger a session update, assuming you already updated the value server-side. + * All `useSession().data` references will be updated. + */} + ) } @@ -245,7 +241,7 @@ The `update()` method won't sync between tabs as the `refetchInterval` and `refe ::: ```tsx title="pages/profile.tsx" -import {useEffect} from "react" +import { useEffect } from "react" import { useSession } from "next-auth/react" export default function Page() { @@ -263,18 +259,17 @@ export default function Page() { // Listen for when the page is visible, if the user switches tabs // and makes our tab visible again, re-fetch the session useEffect(() => { - const visibilityHandler = () => document.visibilityState === "visible" && update() + const visibilityHandler = () => + document.visibilityState === "visible" && update() window.addEventListener("visibilitychange", visibilityHandler, false) - return () => window.removeEventListener("visibilitychange", visibilityHandler, false) + return () => + window.removeEventListener("visibilitychange", visibilityHandler, false) }, [update]) - return ( -
-      {JSON.stringify(session, null, 2)}
-    
- ) + return
{JSON.stringify(session, null, 2)}
} ``` + --- ## getSession() @@ -288,7 +283,7 @@ On the server side, **this is still available to use**, however, we recommend us This helper is helpful in case you want to read the session outside of the context of React. -When called, `getSession()` will send a request to `/api/auth/session` and returns a promise with a [session object](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/core/types.ts#L407-L425), or `null` if no session exists. +When called, `getSession()` will send a request to `/api/auth/session` and returns a promise with a [session object](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/core/types.ts#L407-L425), or `null` if no session exists. ```js async function myFunction() { @@ -520,7 +515,7 @@ where `data.url` is the validated URL you can redirect the user to without any f ## SessionProvider :::note -If you are using the App Router, we encourage you to use [`getServerSession`](/configuration/nextjs#getserversession) in server contexts instead. (`SessionProvider` *can* be used in the App Router, which might be the easier choice if you are migrating from pages.) +If you are using the App Router, we encourage you to use [`getServerSession`](/configuration/nextjs#getserversession) in server contexts instead. (`SessionProvider` _can_ be used in the App Router, which might be the easier choice if you are migrating from pages.) ::: Using the supplied `` allows instances of `useSession()` to share the session object across components, by using [React Context](https://react.dev/learn/passing-data-deeply-with-context) under the hood. It also takes care of keeping the session updated and synced between tabs/windows. @@ -633,11 +628,13 @@ See [**the Next.js documentation**](https://nextjs.org/docs/advanced-features/cu ::: ### Custom base path + When your Next.js application uses a custom base path, set the `NEXTAUTH_URL` environment variable to the route to the API endpoint in full - as in the example below and as explained [here](/configuration/options#nextauth_url). Also, make sure to pass the `basePath` page prop to the `` – as in the example below – so your custom base path is fully configured and used by NextAuth.js. #### Example + In this example, the custom base path used is `/custom-route`. ``` diff --git a/docs/docs/providers/42.md b/docs/docs/providers/42.md index 378419dc2a..5d3a573dee 100644 --- a/docs/docs/providers/42.md +++ b/docs/docs/providers/42.md @@ -19,7 +19,7 @@ https://profile.intra.42.fr/oauth/applications/new The **42 School Provider** comes with a set of default options: -- [42 School Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/42-school.ts) +- [42 School Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/42-school.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/apple.md b/docs/docs/providers/apple.md index c88f03a313..9e317fba21 100644 --- a/docs/docs/providers/apple.md +++ b/docs/docs/providers/apple.md @@ -15,7 +15,7 @@ https://developer.apple.com/account/resources/identifiers/list/serviceId The **Apple Provider** comes with a set of default options: -- [Apple Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/apple.ts) +- [Apple Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/apple.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/atlassian.md b/docs/docs/providers/atlassian.md index 759a33bf86..761e9f8c0a 100644 --- a/docs/docs/providers/atlassian.md +++ b/docs/docs/providers/atlassian.md @@ -11,7 +11,7 @@ https://developer.atlassian.com/cloud/jira/platform/oauth-2-authorization-code-g The **Atlassian Provider** comes with a set of default options: -- [Atlassian Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/atlassian.ts) +- [Atlassian Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/atlassian.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/authentik.md b/docs/docs/providers/authentik.md index c1887318a8..a96f45ae81 100644 --- a/docs/docs/providers/authentik.md +++ b/docs/docs/providers/authentik.md @@ -11,7 +11,7 @@ https://goauthentik.io/docs/providers/oauth2 The **Authentik Provider** comes with a set of default options: -- [Authentik Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/authentik.ts) +- [Authentik Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/authentik.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/azure-ad-b2c.md b/docs/docs/providers/azure-ad-b2c.md index 3e3b9314a0..218ac1d9ed 100644 --- a/docs/docs/providers/azure-ad-b2c.md +++ b/docs/docs/providers/azure-ad-b2c.md @@ -26,7 +26,7 @@ https://docs.microsoft.com/azure/active-directory-b2c/tutorial-create-tenant The **Azure Active Directory Provider** comes with a set of default options: -- [Azure Active Directory Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/azure-ad-b2c.ts) +- [Azure Active Directory Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/azure-ad-b2c.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/battlenet.md b/docs/docs/providers/battlenet.md index 2541f7d4e2..30354ffb21 100644 --- a/docs/docs/providers/battlenet.md +++ b/docs/docs/providers/battlenet.md @@ -15,7 +15,7 @@ https://develop.battle.net/access/clients The **Battle.net Provider** comes with a set of default options: -- [Battle.net Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/battlenet.js) +- [Battle.net Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/battlenet.js) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/box.md b/docs/docs/providers/box.md index c7ce0c9e83..05d79c5020 100644 --- a/docs/docs/providers/box.md +++ b/docs/docs/providers/box.md @@ -15,7 +15,7 @@ https://developer.box.com/guides/sso-identities-and-app-users/connect-okta-to-ap The **Box Provider** comes with a set of default options: -- [Box Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/box.js) +- [Box Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/box.js) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/boxyhq-saml.md b/docs/docs/providers/boxyhq-saml.md index a2e6757029..6ef090cf7b 100644 --- a/docs/docs/providers/boxyhq-saml.md +++ b/docs/docs/providers/boxyhq-saml.md @@ -19,7 +19,7 @@ Check out the [documentation](https://boxyhq.com/docs/jackson/saml-flow#2-saml-c The **BoxyHQ SAML Provider** comes with a set of default options: -- [BoxyHQ Provider options](https://github.com/nextauthjs/next-auth/tree/main/packages/next-auth/src/providers/boxyhq-saml.ts) +- [BoxyHQ Provider options](https://github.com/nextauthjs/next-auth/tree/v4/packages/next-auth/src/providers/boxyhq-saml.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/bungie.md b/docs/docs/providers/bungie.md index 4b1af759dc..467fb494b0 100644 --- a/docs/docs/providers/bungie.md +++ b/docs/docs/providers/bungie.md @@ -15,7 +15,7 @@ https://www.bungie.net/en/Application The **Bungie Provider** comes with a set of default options: -- [Bungie Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/bungie.js) +- [Bungie Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/bungie.js) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/cognito.md b/docs/docs/providers/cognito.md index 5638abb468..55c4b6391b 100644 --- a/docs/docs/providers/cognito.md +++ b/docs/docs/providers/cognito.md @@ -17,7 +17,7 @@ You need to select your AWS region to go the the Cognito dashboard. The **Amazon Cognito Provider** comes with a set of default options: -- [Amazon Cognito Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/cognito.ts) +- [Amazon Cognito Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/cognito.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/coinbase.md b/docs/docs/providers/coinbase.md index 655b26a096..1704cd5776 100644 --- a/docs/docs/providers/coinbase.md +++ b/docs/docs/providers/coinbase.md @@ -15,7 +15,7 @@ https://www.coinbase.com/settings/api The **Coinbase Provider** comes with a set of default options: -- [Coinbase Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/coinbase.js) +- [Coinbase Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/coinbase.js) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/dropbox.md b/docs/docs/providers/dropbox.md index 5cdd1edede..eafc4569c7 100644 --- a/docs/docs/providers/dropbox.md +++ b/docs/docs/providers/dropbox.md @@ -15,7 +15,7 @@ https://www.dropbox.com/developers/apps The **Dropbox Provider** comes with a set of default options: -- [Dropbox Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/dropbox.js) +- [Dropbox Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/dropbox.js) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/email.md b/docs/docs/providers/email.md index 5268377250..2d30bed891 100644 --- a/docs/docs/providers/email.md +++ b/docs/docs/providers/email.md @@ -15,7 +15,6 @@ The Email provider can be used in conjunction with (or instead of) one or more O On initial sign in, a **Verification Token** is sent to the email address provided. By default this token is valid for 24 hours. If the Verification Token is used within that time (i.e. by clicking on the link in the email) an account is created for the user and they are signed in. - If someone provides the email address of an _existing account_ when signing in, an email is sent and they are signed into the account associated with that email address when they follow the link in the email. :::tip @@ -26,7 +25,7 @@ The Email Provider can be used with both JSON Web Tokens and database sessions, The **Email Provider** comes with a set of default options: -- [Email Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/email.ts) +- [Email Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/email.ts) You can override any of the options to suit your own use case. @@ -161,7 +160,7 @@ async function sendVerificationRequest(params) { * * @note We don't add the email address to avoid needing to escape it, if you do, remember to sanitize it! */ -function html(params: { url: string; host: string; theme: Theme }) { +function html(params: { url: string, host: string, theme: Theme }) { const { url, host, theme } = params const escapedHost = host.replace(/\./g, "​.") @@ -210,7 +209,7 @@ function html(params: { url: string; host: string; theme: Theme }) { } /** Email Text body (fallback for email clients that don't render HTML, e.g. feature phones) */ -function text({ url, host }: { url: string; host: string }) { +function text({ url, host }: { url: string, host: string }) { return `Sign in to ${host}\n${url}\n\n` } ``` @@ -236,51 +235,51 @@ providers: [ ## Normalizing the email address By default, NextAuth.js will normalize the email address. It treats values as case-insensitive (which is technically not compliant to the [RFC 2821 spec](https://datatracker.ietf.org/doc/html/rfc2821), but in practice this causes more problems than it solves, eg. when looking up users by e-mail from databases.) and also removes any secondary email address that was passed in as a comma-separated list. You can apply your own normalization via the `normalizeIdentifier` method on the `EmailProvider`. The following example shows the default behavior: + ```ts - EmailProvider({ - // ... - normalizeIdentifier(identifier: string): string { - // Get the first two elements only, - // separated by `@` from user input. - let [local, domain] = identifier.toLowerCase().trim().split("@") - // The part before "@" can contain a "," - // but we remove it on the domain part - domain = domain.split(",")[0] - return `${local}@${domain}` - - // You can also throw an error, which will redirect the user - // to the error page with error=EmailSignin in the URL - // if (identifier.split("@").length > 2) { - // throw new Error("Only one email allowed") - // } - }, - }) +EmailProvider({ + // ... + normalizeIdentifier(identifier: string): string { + // Get the first two elements only, + // separated by `@` from user input. + let [local, domain] = identifier.toLowerCase().trim().split("@") + // The part before "@" can contain a "," + // but we remove it on the domain part + domain = domain.split(",")[0] + return `${local}@${domain}` + + // You can also throw an error, which will redirect the user + // to the error page with error=EmailSignin in the URL + // if (identifier.split("@").length > 2) { + // throw new Error("Only one email allowed") + // } + }, +}) ``` :::warning Always make sure this returns a single e-mail address, even if multiple ones were passed in. ::: - ## Sending Magic Links To Existing Users -You can ensure that only existing users are sent a magic login link. You will need to grab the email the user entered and check your database to see if the email already exists in the "User" collection in your database. If it exists, it will send the user a magic link but otherwise, you can send the user to another page, such as "/register". - - ```js title="pages/api/auth/[...nextauth].js" - import User from "../../../models/User"; - import db from "../../../utils/db"; - ... - callbacks: { - async signIn({ user, account, email }) { - await db.connect(); - const userExists = await User.findOne({ - email: user.email, //the user object has an email property, which contains the email the user entered. - }); - if (userExists) { - return true; //if the email exists in the User collection, email them a magic login link - } else { - return "/register"; - } - }, - ... - ``` +You can ensure that only existing users are sent a magic login link. You will need to grab the email the user entered and check your database to see if the email already exists in the "User" collection in your database. If it exists, it will send the user a magic link but otherwise, you can send the user to another page, such as "/register". + +```js title="pages/api/auth/[...nextauth].js" +import User from "../../../models/User"; +import db from "../../../utils/db"; +... +callbacks: { + async signIn({ user, account, email }) { + await db.connect(); + const userExists = await User.findOne({ + email: user.email, //the user object has an email property, which contains the email the user entered. + }); + if (userExists) { + return true; //if the email exists in the User collection, email them a magic login link + } else { + return "/register"; + } + }, + ... +``` diff --git a/docs/docs/providers/eveonline.md b/docs/docs/providers/eveonline.md index dfb922ba20..8fd9123d1b 100644 --- a/docs/docs/providers/eveonline.md +++ b/docs/docs/providers/eveonline.md @@ -15,7 +15,7 @@ https://developers.eveonline.com/ The **EVE Online Provider** comes with a set of default options: -- [EVE Online Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/eveonline.ts) +- [EVE Online Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/eveonline.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/facebook.md b/docs/docs/providers/facebook.md index be3d73bf3e..f98794c5b8 100644 --- a/docs/docs/providers/facebook.md +++ b/docs/docs/providers/facebook.md @@ -15,7 +15,7 @@ https://developers.facebook.com/apps/ The **Facebook Provider** comes with a set of default options: -- [Facebook Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/facebook.ts) +- [Facebook Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/facebook.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/faceit.md b/docs/docs/providers/faceit.md index 6c2c21c976..91c3e3d057 100644 --- a/docs/docs/providers/faceit.md +++ b/docs/docs/providers/faceit.md @@ -19,7 +19,7 @@ Scopes to have basic infos (email, nickname, guid and avatar) : `openid`, `email The **FACEIT Provider** comes with a set of default options: -- [FACEIT Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/faceit.js) +- [FACEIT Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/faceit.js) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/foursquare.md b/docs/docs/providers/foursquare.md index dbac1078b0..642ff400a6 100644 --- a/docs/docs/providers/foursquare.md +++ b/docs/docs/providers/foursquare.md @@ -19,7 +19,7 @@ Foursquare requires an additional `apiVersion` parameter in [`YYYYMMDD` format]( The **Foursquare Provider** comes with a set of default options: -- [Foursquare Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/foursquare.js) +- [Foursquare Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/foursquare.js) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/fusionauth.md b/docs/docs/providers/fusionauth.md index 32308f90f2..08bff4efc2 100644 --- a/docs/docs/providers/fusionauth.md +++ b/docs/docs/providers/fusionauth.md @@ -11,7 +11,7 @@ https://fusionauth.io/docs/v1/tech/oauth/ The **FusionAuth Provider** comes with a set of default options: -- [FusionAuth Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/fusionauth.ts) +- [FusionAuth Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/fusionauth.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/github.md b/docs/docs/providers/github.md index 89fdb68ded..bbe1845198 100644 --- a/docs/docs/providers/github.md +++ b/docs/docs/providers/github.md @@ -19,7 +19,7 @@ https://github.com/settings/apps The **GitHub Provider** comes with a set of default options: -- [GitHub Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/github.ts) +- [GitHub Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/github.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/gitlab.md b/docs/docs/providers/gitlab.md index 9fba6d44d7..08a8247121 100644 --- a/docs/docs/providers/gitlab.md +++ b/docs/docs/providers/gitlab.md @@ -19,7 +19,7 @@ https://gitlab.com/-/profile/applications The **Gitlab Provider** comes with a set of default options: -- [Gitlab Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/gitlab.ts) +- [Gitlab Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/gitlab.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/google.md b/docs/docs/providers/google.md index c4399eacbd..fdeb32cbc1 100644 --- a/docs/docs/providers/google.md +++ b/docs/docs/providers/google.md @@ -20,7 +20,7 @@ The "Authorized redirect URIs" used when creating the credentials must include y The **Google Provider** comes with a set of default options: -- [Google Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/google.ts) +- [Google Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/google.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/hubspot.md b/docs/docs/providers/hubspot.md index ac5afbe172..a281706e0b 100644 --- a/docs/docs/providers/hubspot.md +++ b/docs/docs/providers/hubspot.md @@ -19,7 +19,7 @@ You need to have an APP in your Developer Account as described at https://develo The **HubSpot Provider** comes with a set of default options: -- [HubSpot Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/hubspot.ts) +- [HubSpot Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/hubspot.ts) You can override any of the options to suit your own use case. @@ -40,4 +40,3 @@ providers: [ :::warning The **Redirect URL** under the **Auth** tab on the HubSpot App Settings page must match the callback url which would be http://localhost:3000/api/auth/callback/hubspot for local development. Only one callback URL per Client ID and Client Secret pair is allowed, so it might be easier to create a new app for local development then fiddle with the url changes. ::: - diff --git a/docs/docs/providers/identity-server4.md b/docs/docs/providers/identity-server4.md index a8c4f5528c..3de365c625 100644 --- a/docs/docs/providers/identity-server4.md +++ b/docs/docs/providers/identity-server4.md @@ -15,7 +15,7 @@ https://identityserver4.readthedocs.io/en/latest/ The **IdentityServer4 Provider** comes with a set of default options: -- [IdentityServer4 Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/identity-server4.js) +- [IdentityServer4 Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/identity-server4.js) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/instagram.md b/docs/docs/providers/instagram.md index 3822123aae..fbaa16bfb1 100644 --- a/docs/docs/providers/instagram.md +++ b/docs/docs/providers/instagram.md @@ -15,7 +15,7 @@ https://developers.facebook.com/apps/ The **Instagram Provider** comes with a set of default options: -- [Instagram Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/instagram.js) +- [Instagram Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/instagram.js) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/kakao.md b/docs/docs/providers/kakao.md index c309058c50..7e0987cc9f 100644 --- a/docs/docs/providers/kakao.md +++ b/docs/docs/providers/kakao.md @@ -15,7 +15,7 @@ https://developers.kakao.com/docs/latest/en/kakaologin/common The **Kakao Provider** comes with a set of default options: -- [Kakao Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/kakao.ts) +- [Kakao Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/kakao.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/keycloak.md b/docs/docs/providers/keycloak.md index 881fbbff82..806feb2f68 100644 --- a/docs/docs/providers/keycloak.md +++ b/docs/docs/providers/keycloak.md @@ -17,7 +17,7 @@ Create an openid-connect client in Keycloak with "confidential" as the "Access T The **Keycloak Provider** comes with a set of default options: -- [Keycloak Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/keycloak.ts) +- [Keycloak Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/keycloak.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/line.md b/docs/docs/providers/line.md index 41fb10fc6a..8fb23011d1 100644 --- a/docs/docs/providers/line.md +++ b/docs/docs/providers/line.md @@ -15,7 +15,7 @@ https://developers.line.biz/console/ The **Line Provider** comes with a set of default options: -- [Line Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/line.ts) +- [Line Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/line.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/linkedin.md b/docs/docs/providers/linkedin.md index 2efe3b81d8..f256c99b2c 100644 --- a/docs/docs/providers/linkedin.md +++ b/docs/docs/providers/linkedin.md @@ -19,7 +19,7 @@ From the Auth tab get the client ID and client secret. On the same tab, add redi The **LinkedIn Provider** comes with a set of default options: -- [LinkedIn Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/linkedin.ts) +- [LinkedIn Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/linkedin.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/mailchimp.md b/docs/docs/providers/mailchimp.md index 833279ff22..838059d508 100644 --- a/docs/docs/providers/mailchimp.md +++ b/docs/docs/providers/mailchimp.md @@ -15,7 +15,7 @@ https://admin.mailchimp.com/account/oauth2/client/ The **Mailchimp Provider** comes with a set of default options: -- [Mailchimp Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/mailchimp.js) +- [Mailchimp Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/mailchimp.js) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/mailru.md b/docs/docs/providers/mailru.md index 306b91b565..2d53e018de 100644 --- a/docs/docs/providers/mailru.md +++ b/docs/docs/providers/mailru.md @@ -15,7 +15,7 @@ https://o2.mail.ru/app/ The **Mail.ru Provider** comes with a set of default options: -- [Mail.ru Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/mailru.js) +- [Mail.ru Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/mailru.js) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/medium.md b/docs/docs/providers/medium.md index 6d2b7a4e21..e90219e89d 100644 --- a/docs/docs/providers/medium.md +++ b/docs/docs/providers/medium.md @@ -15,7 +15,7 @@ https://medium.com/me/applications The **Medium Provider** comes with a set of default options: -- [Medium Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/medium.js) +- [Medium Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/medium.js) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/naver.md b/docs/docs/providers/naver.md index 8486c1c3fa..40964b3efe 100644 --- a/docs/docs/providers/naver.md +++ b/docs/docs/providers/naver.md @@ -15,7 +15,7 @@ https://developers.naver.com/docs/login/api/api.md The **Naver Provider** comes with a set of default options: -- [Naver Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/naver.js) +- [Naver Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/naver.js) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/netlify.md b/docs/docs/providers/netlify.md index eb55b639b0..132cc8b1c4 100644 --- a/docs/docs/providers/netlify.md +++ b/docs/docs/providers/netlify.md @@ -15,7 +15,7 @@ https://github.com/netlify/netlify-oauth-example The **Netlify Provider** comes with a set of default options: -- [Netlify Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/netlify.js) +- [Netlify Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/netlify.js) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/okta.md b/docs/docs/providers/okta.md index 4f7bec98d4..0e02014679 100644 --- a/docs/docs/providers/okta.md +++ b/docs/docs/providers/okta.md @@ -11,7 +11,7 @@ https://developer.okta.com/docs/reference/api/oidc The **Okta Provider** comes with a set of default options: -- [Okta Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/okta.ts) +- [Okta Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/okta.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/onelogin.md b/docs/docs/providers/onelogin.md index 236e6266fb..d28bb06184 100644 --- a/docs/docs/providers/onelogin.md +++ b/docs/docs/providers/onelogin.md @@ -15,7 +15,7 @@ https://developers.onelogin.com/openid-connect/connect-to-onelogin The **OneLogin Provider** comes with a set of default options: -- [OneLogin Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/onelogin.js) +- [OneLogin Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/onelogin.js) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/osso.md b/docs/docs/providers/osso.md index aaa4713efc..4e66a5fd00 100644 --- a/docs/docs/providers/osso.md +++ b/docs/docs/providers/osso.md @@ -21,7 +21,7 @@ See Osso's complete configuration and testing documentation at https://ossoapp.c The **Osso Provider** comes with a set of default options: -- [Osso Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/osso.js) +- [Osso Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/osso.js) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/osu.md b/docs/docs/providers/osu.md index e524927d07..8a560afe59 100644 --- a/docs/docs/providers/osu.md +++ b/docs/docs/providers/osu.md @@ -15,7 +15,7 @@ https://osu.ppy.sh/home/account/edit#new-oauth-application The **Osu Provider** comes with a set of default options: -- [Osu Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/osu.ts) +- [Osu Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/osu.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/patreon.md b/docs/docs/providers/patreon.md index b36758eee6..4e89e83ae7 100644 --- a/docs/docs/providers/patreon.md +++ b/docs/docs/providers/patreon.md @@ -17,7 +17,7 @@ Create a API v2 client on [Patreon Platform](https://www.patreon.com/portal/regi The **Patreon Provider** comes with a set of default options: -- [Patreon Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/patreon.ts) +- [Patreon Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/patreon.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/pinterest.md b/docs/docs/providers/pinterest.md index 57318e729d..f60fd2fbc2 100644 --- a/docs/docs/providers/pinterest.md +++ b/docs/docs/providers/pinterest.md @@ -15,7 +15,7 @@ https://developers.pinterest.com/apps/ The **Pinterest Provider** comes with a set of default options: -- [Pinterest Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/pinterest.ts) +- [Pinterest Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/pinterest.ts) You can override any of the options to suit your own use case. @@ -35,3 +35,4 @@ providers: [ :::tip To use in production, make sure the app has standard API access and not trial access ::: +``` diff --git a/docs/docs/providers/pipedrive.md b/docs/docs/providers/pipedrive.md index 74cda40925..30277266fc 100644 --- a/docs/docs/providers/pipedrive.md +++ b/docs/docs/providers/pipedrive.md @@ -11,7 +11,7 @@ https://pipedrive.readme.io/docs/marketplace-oauth-authorization The **Pipedrive Provider** comes with a set of default options: -- [Pipedrive Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/pipedrive.ts) +- [Pipedrive Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/pipedrive.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/reddit.md b/docs/docs/providers/reddit.md index fd323fab94..04e100e9e3 100644 --- a/docs/docs/providers/reddit.md +++ b/docs/docs/providers/reddit.md @@ -22,7 +22,7 @@ https://www.reddit.com/dev/api/ The **Reddit Provider** comes with a set of default options: -- [Reddit Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/reddit.js) +- [Reddit Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/reddit.js) You can override any of the options to suit your own use case. @@ -58,7 +58,7 @@ providers: [ clientSecret: process.env.REDDIT_CLIENT_SECRET, authorization: { params: { - duration: 'permanent', + duration: "permanent", }, }, }), diff --git a/docs/docs/providers/salesforce.md b/docs/docs/providers/salesforce.md index d65075715d..f5dde46a14 100644 --- a/docs/docs/providers/salesforce.md +++ b/docs/docs/providers/salesforce.md @@ -11,7 +11,7 @@ https://help.salesforce.com/articleView?id=remoteaccess_authenticate.htm&type=5 The **Salesforce Provider** comes with a set of default options: -- [Salesforce Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/salesforce.ts) +- [Salesforce Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/salesforce.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/slack.md b/docs/docs/providers/slack.md index 41cd63173b..83c7a5e858 100644 --- a/docs/docs/providers/slack.md +++ b/docs/docs/providers/slack.md @@ -22,7 +22,7 @@ Slack requires that the redirect URL of your app uses `https`, even for local de The **Slack Provider** comes with a set of default options: -- [Slack Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/slack.ts) +- [Slack Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/slack.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/spotify.md b/docs/docs/providers/spotify.md index 1462bb57dc..2d155d0e99 100644 --- a/docs/docs/providers/spotify.md +++ b/docs/docs/providers/spotify.md @@ -15,7 +15,7 @@ https://developer.spotify.com/dashboard/applications The **Spotify Provider** comes with a set of default options: -- [Spotify Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/spotify.ts) +- [Spotify Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/spotify.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/strava.md b/docs/docs/providers/strava.md index a3a16519bc..8574af3ce8 100644 --- a/docs/docs/providers/strava.md +++ b/docs/docs/providers/strava.md @@ -11,7 +11,7 @@ http://developers.strava.com/docs/reference/ The **Strava Provider** comes with a set of default options: -- [Strava Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/strava.ts) +- [Strava Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/strava.ts) You can override any of the options to suit your own use case. Ensure the redirect_uri configuration fits your needs accordingly. diff --git a/docs/docs/providers/todoist.md b/docs/docs/providers/todoist.md index 3fab7cffa6..ccd589f086 100644 --- a/docs/docs/providers/todoist.md +++ b/docs/docs/providers/todoist.md @@ -15,7 +15,7 @@ https://developer.todoist.com/appconsole.html The **Todoist Provider** comes with a set of default options: -- [Todoist Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/todoist.ts) +- [Todoist Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/todoist.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/trakt.md b/docs/docs/providers/trakt.md index 78f7437a17..0ea334a3ac 100644 --- a/docs/docs/providers/trakt.md +++ b/docs/docs/providers/trakt.md @@ -17,7 +17,7 @@ Start by creating an OAuth app on Trakt for [production](https://trakt.tv/oauth/ The **Trakt Provider** comes with a set of default options: -- [Trakt Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/trakt.ts) +- [Trakt Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/trakt.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/twitch.md b/docs/docs/providers/twitch.md index 17ec61d0a4..ab34c80a1a 100644 --- a/docs/docs/providers/twitch.md +++ b/docs/docs/providers/twitch.md @@ -17,7 +17,7 @@ Add the following redirect URL into the console `http:///api/ The **Twitch Provider** comes with a set of default options: -- [Twitch Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/twitch.ts) +- [Twitch Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/twitch.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/twitter.md b/docs/docs/providers/twitter.md index 99129d44c9..1bb653eb28 100644 --- a/docs/docs/providers/twitter.md +++ b/docs/docs/providers/twitter.md @@ -19,7 +19,7 @@ https://developer.twitter.com/en/apps The **Twitter Provider** comes with a set of default options: -- [Twitter Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/twitter.ts) +- [Twitter Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/twitter.ts) You can override any of the options to suit your own use case. @@ -58,5 +58,5 @@ TwitterProvider({ Keep in mind that although this change is easy, it changes how and with which of [Twitter APIs](https://developer.twitter.com/en/docs/api-reference-index) you can interact with. Read the official [Twitter OAuth 2 documentation](https://developer.twitter.com/en/docs/authentication/oauth-2-0) for more details. :::note -Email is currently not supported by Twitter OAuth 2.0. +Email is currently not supported by Twitter OAuth 2.0. ::: diff --git a/docs/docs/providers/united-effects.md b/docs/docs/providers/united-effects.md index 7cc732e86e..d85d301f79 100644 --- a/docs/docs/providers/united-effects.md +++ b/docs/docs/providers/united-effects.md @@ -15,7 +15,7 @@ https://core.unitedeffects.com The **United Effects Provider** comes with a set of default options: -- [United Effects Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/united-effects.ts) +- [United Effects Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/united-effects.ts) You can override any of the options to suit your own use case. @@ -40,4 +40,4 @@ providers: [ :::warning The United Effects API does not return the user name or image by design, so this provider will return null for both. United Effects prioritizes user personal information security above all and has built a secured profile access request system separate from the provider API. -::: \ No newline at end of file +::: diff --git a/docs/docs/providers/vk.md b/docs/docs/providers/vk.md index 90d9417fe6..0c87f29c49 100644 --- a/docs/docs/providers/vk.md +++ b/docs/docs/providers/vk.md @@ -15,7 +15,7 @@ https://vk.com/apps?act=manage The **VK Provider** comes with a set of default options: -- [VK Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/vk.ts) +- [VK Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/vk.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/wikimedia.md b/docs/docs/providers/wikimedia.md index 47d3f2533e..134703cfa9 100644 --- a/docs/docs/providers/wikimedia.md +++ b/docs/docs/providers/wikimedia.md @@ -21,9 +21,9 @@ Please be aware that Wikimedia accounts do not have to have an associated email 1. Go to and accept the Consumer Registration doc: https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration 2. Request a new OAuth 2.0 consumer to get the `clientId` and `clientSecret`: https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/propose/oauth2 - 2a. Add the following redirect URL into the console `http:///api/auth/callback/wikimedia` - 2b. Do not check the box next to `This consumer is only for [your username]` - 2c. Unless you explicitly need a larger scope, feel free to select the radio button labelled `User identity verification only - no ability to read pages or act on the users behalf.` + 2a. Add the following redirect URL into the console `http:///api/auth/callback/wikimedia` + 2b. Do not check the box next to `This consumer is only for [your username]` + 2c. Unless you explicitly need a larger scope, feel free to select the radio button labelled `User identity verification only - no ability to read pages or act on the users behalf.` After registration, you can initally test your application only with your own Wikimedia account. You may have to wait several days for the application to be approved for it to be used by everyone. @@ -31,7 +31,7 @@ After registration, you can initally test your application only with your own Wi The **Wikimedia Provider** comes with a set of default options: -- [Wikimedia Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/wikimedia.ts) +- [Wikimedia Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/wikimedia.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/wordpress.md b/docs/docs/providers/wordpress.md index ba2132910d..0bf9f45263 100644 --- a/docs/docs/providers/wordpress.md +++ b/docs/docs/providers/wordpress.md @@ -15,7 +15,7 @@ https://developer.wordpress.com/apps/ The **Wordpress Provider** comes with a set of default options: -- [Wordpress Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/wordpress.js) +- [Wordpress Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/wordpress.js) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/workos.md b/docs/docs/providers/workos.md index 080385928e..b47cce6929 100644 --- a/docs/docs/providers/workos.md +++ b/docs/docs/providers/workos.md @@ -15,7 +15,7 @@ https://dashboard.workos.com The **WorkOS Provider** comes with a set of default options: -- [WorkOS Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/workos.ts) +- [WorkOS Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/workos.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/yandex.md b/docs/docs/providers/yandex.md index d5239718ac..e10ceefc0e 100644 --- a/docs/docs/providers/yandex.md +++ b/docs/docs/providers/yandex.md @@ -15,7 +15,7 @@ https://oauth.yandex.com/client/new The **Yandex Provider** comes with a set of default options: -- [Yandex Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/yandex.js) +- [Yandex Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/yandex.js) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/zitadel.md b/docs/docs/providers/zitadel.md index 47d4413d35..54f27fbd27 100644 --- a/docs/docs/providers/zitadel.md +++ b/docs/docs/providers/zitadel.md @@ -22,7 +22,7 @@ Make sure to enable **dev mode** in ZITADEL console to allow redirects for local The **ZITADEL Provider** comes with a set of default options: -- [ZITADEL Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/zitadel.ts) +- [ZITADEL Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/zitadel.ts) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/zoho.md b/docs/docs/providers/zoho.md index 4320cdd140..17617b84d0 100644 --- a/docs/docs/providers/zoho.md +++ b/docs/docs/providers/zoho.md @@ -19,7 +19,7 @@ https://api-console.zoho.com/ The **Zoho Provider** comes with a set of default options: -- [Zoho Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/zoho.js) +- [Zoho Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/zoho.js) You can override any of the options to suit your own use case. diff --git a/docs/docs/providers/zoom.md b/docs/docs/providers/zoom.md index c854b192e6..d25722670c 100644 --- a/docs/docs/providers/zoom.md +++ b/docs/docs/providers/zoom.md @@ -15,7 +15,7 @@ https://marketplace.zoom.us The **Zoom Provider** comes with a set of default options: -- [Zoom Provider options](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/zoom.ts) +- [Zoom Provider options](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/providers/zoom.ts) You can override any of the options to suit your own use case.