Skip to content

Commit a858656

Browse files
committed
Merge branch 'main' of ssh://github.com/nextauthjs/next-auth
2 parents a633d9a + d3eb3f9 commit a858656

File tree

4 files changed

+27
-7
lines changed

4 files changed

+27
-7
lines changed

docs/components/OAuthProviderInstructions/content/components/SetupCode.tsx

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ export function SetupCode({ providerId, providerName, highlight }: Props) {
1212
return (
1313
<Code>
1414
<Code.Next>
15+
In Next.js we recommend setting up your configuration in a file in the root of your repository, like at{" "}
16+
<code>auth.ts</code>.
17+
<br />
1518
<Pre
16-
data-filename="@/auth"
19+
data-filename="./auth.ts"
1720
data-theme="default"
1821
data-copy=""
1922
data-language="tsx"
@@ -23,15 +26,32 @@ export function SetupCode({ providerId, providerName, highlight }: Props) {
2326
import NextAuth from "next-auth"
2427
import ${providerName} from "next-auth/providers/${providerId}"
2528
26-
export const { signIn, signOut, auth } = NextAuth({
29+
export const { handlers, signIn, signOut, auth } = NextAuth({
2730
providers: [${providerName}],
2831
})`),
2932
}}
3033
/>
34+
<br />
35+
Add the <code>handlers</code> which <code>NextAuth</code> returns to
36+
your <code>api/auth/[...nextauth]/route.ts</code> file so that Auth.js
37+
can run on any incoming request.
38+
<Pre
39+
data-filename="./app/api/auth/[...nextauth]/route.ts"
40+
data-theme="default"
41+
data-copy=""
42+
data-language="tsx"
43+
icon={TSIcon}
44+
dangerouslySetInnerHTML={{
45+
__html: highlight(`
46+
import { handlers } from "@/auth"
47+
export const { GET, POST } = handlers
48+
`),
49+
}}
50+
/>
3151
</Code.Next>
3252
<Code.Svelte>
3353
In SvelteKit you should also setup your Auth.js configuration in a file
34-
at `/src/auth.ts`.
54+
at <code>/src/auth.ts</code>.
3555
<br />
3656
<Pre
3757
data-filename="./src/auth.ts"
@@ -44,7 +64,7 @@ export const { signIn, signOut, auth } = NextAuth({
4464
import { SvelteKitAuth } from "@auth/sveltekit"
4565
import ${providerName} from "@auth/sveltekit/providers/${providerId}"
4666
47-
export const { handle } = SvelteKitAuth({
67+
export const { handle, signIn } = SvelteKitAuth({
4868
providers: [${providerName}],
4969
}) `),
5070
}}

docs/pages/getting-started/adapters/drizzle.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ If you want to modify the schema or add additional fields, you can use the follo
4646

4747
```ts filename="schema.ts"
4848
import {
49-
boolean
49+
boolean,
5050
timestamp,
5151
pgTable,
5252
text,

docs/pages/getting-started/providers/boxyhq-saml.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Code } from "@/components/Code"
1212

1313
## Resources
1414

15-
- [BoxyHQ OAuth documentation](https://example.com)
15+
- [BoxyHQ OAuth documentation](https://boxyhq.com/docs/jackson/overview)
1616

1717
## Setup
1818

docs/pages/guides/edge-compatibility.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export const { handlers, auth, signIn, signOut } = NextAuth({
9090
import NextAuth from "next-auth"
9191
import authConfig from "./auth.config"
9292

93-
export const { auth as middleware } = NextAuth(authConfig)
93+
export const { auth: middleware } = NextAuth(authConfig)
9494
```
9595

9696
4. Finally, everywhere else we can import from the primary `auth.ts` configuration and use `next-auth` as usual. See our [session management docs](/getting-started/session-management/protecting) for more examples.

0 commit comments

Comments
 (0)