create-tnt-stack 0.4.3 → 0.4.4-beta.255730d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/index.js +19 -19
- package/package.json +86 -86
- package/template/base/README.md +1 -1
- package/template/packages/prisma/schema/{with-next-auth.prisma → with-authjs.prisma} +2 -2
- package/template/packages/src/app/layout/base.tsx +2 -2
- package/template/packages/src/app/page/base.tsx +79 -87
- package/template/packages/src/app/page/with-authjs.tsx +126 -0
- package/template/packages/src/app/page/with-payload.tsx +98 -20
- package/template/packages/src/server/auth/authjs.ts +5 -0
- package/template/packages/src/server/auth/config/authjs-with-prisma.ts +30 -0
- package/template/packages/src/server/auth/config/authjs.ts +27 -0
- package/template/packages/src/app/globals/with-payload.css +0 -166
- package/template/packages/src/app/layout/with-payload.tsx +0 -20
- package/template/packages/src/server/auth/config/next-auth-with-prisma.ts +0 -60
- package/template/packages/src/server/auth/config/next-auth.ts +0 -57
- package/template/packages/src/server/auth/next-auth.ts +0 -10
- /package/template/packages/src/env/{with-next-auth-db.js → with-authjs-db.js} +0 -0
- /package/template/packages/src/env/{with-next-auth.js → with-authjs.js} +0 -0
@@ -1,105 +1,97 @@
|
|
1
|
-
import
|
1
|
+
import { fileURLToPath } from "url"
|
2
2
|
|
3
3
|
export default function HomePage() {
|
4
|
+
const fileURL = `vscode://file/${fileURLToPath(import.meta.url)}`
|
5
|
+
|
4
6
|
return (
|
5
|
-
<main className="flex
|
6
|
-
|
7
|
-
|
8
|
-
<
|
7
|
+
<main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-[45px]">
|
8
|
+
<div className="flex grow flex-col items-center justify-center">
|
9
|
+
{/* Logo */}
|
10
|
+
<picture className="relative">
|
9
11
|
<div className="absolute inset-0 animate-pulse rounded-xl bg-gradient-to-r from-purple-500 to-cyan-500 opacity-20 blur-xl dark:from-purple-800 dark:to-cyan-800" />
|
10
|
-
<
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
strokeLinejoin="round"
|
20
|
-
className="rounded-lg bg-gradient-to-r from-purple-500 to-cyan-500 dark:from-purple-800 dark:to-cyan-800"
|
21
|
-
>
|
22
|
-
<polyline points="4 17 10 11 4 5" />
|
23
|
-
<line x1="12" x2="20" y1="19" y2="19" />
|
24
|
-
</svg>
|
25
|
-
</div>
|
26
|
-
</div>
|
12
|
+
<source srcSet="https://github.com/SlickYeet/create-tnt-stack/blob/main/docs/public/logo.light.png?raw=true" />
|
13
|
+
<img
|
14
|
+
src="https://github.com/SlickYeet/create-tnt-stack/blob/main/docs/public/logo.light.png?raw=true"
|
15
|
+
alt="Logo"
|
16
|
+
width={65}
|
17
|
+
height={65}
|
18
|
+
className="block h-auto max-w-full"
|
19
|
+
/>
|
20
|
+
</picture>
|
27
21
|
|
28
|
-
|
29
|
-
<h1 className="mb-8 bg-gradient-to-r from-purple-500 to-cyan-500 bg-clip-text pb-1.5 text-6xl font-bold tracking-tighter text-transparent md:text-7xl lg:text-8xl">
|
22
|
+
<h1 className="mt-6 bg-gradient-to-r from-purple-500 to-cyan-500 bg-clip-text text-center text-4xl leading-10 text-transparent sm:text-5xl sm:leading-14 md:text-6xl md:leading-20 lg:mt-10 lg:text-7xl lg:font-bold">
|
30
23
|
TNT-Powered Next.js App
|
31
24
|
</h1>
|
32
|
-
<p className="
|
25
|
+
<p className="mt-4 text-center text-lg text-neutral-700 md:text-xl lg:mt-6 dark:text-neutral-300">
|
33
26
|
Build modern web applications with today's most popular tools
|
34
27
|
</p>
|
35
|
-
</div>
|
36
28
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
>
|
44
|
-
Website
|
45
|
-
<svg
|
46
|
-
xmlns="http://www.w3.org/2000/svg"
|
47
|
-
viewBox="0 0 24 24"
|
48
|
-
strokeLinecap="round"
|
49
|
-
strokeLinejoin="round"
|
50
|
-
className="absolute top-0 -right-4 size-4 fill-none stroke-current stroke-2"
|
29
|
+
<div className="mt-12 flex items-center gap-3">
|
30
|
+
<a
|
31
|
+
href="https://create.tntstack.org"
|
32
|
+
target="_blank"
|
33
|
+
rel="noopener noreferrer"
|
34
|
+
className="flex items-center rounded-md border border-white px-2 py-1 outline-none focus:opacity-80 active:opacity-70"
|
51
35
|
>
|
52
|
-
|
53
|
-
<
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
<
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
className="absolute top-0 -right-4 size-4 fill-none stroke-current stroke-2"
|
36
|
+
Website
|
37
|
+
<svg
|
38
|
+
xmlns="http://www.w3.org/2000/svg"
|
39
|
+
viewBox="0 0 24 24"
|
40
|
+
strokeLinecap="round"
|
41
|
+
strokeLinejoin="round"
|
42
|
+
className="mb-1.5 size-4 fill-none stroke-current stroke-2"
|
43
|
+
>
|
44
|
+
<path d="M7 7h10v10" />
|
45
|
+
<path d="M7 17 17 7" />
|
46
|
+
</svg>
|
47
|
+
</a>
|
48
|
+
<a
|
49
|
+
href="https://create.tntstack.org/introduction"
|
50
|
+
target="_blank"
|
51
|
+
rel="noopener noreferrer"
|
52
|
+
className="flex items-center rounded-md border border-white px-2 py-1 outline-none focus:opacity-80 active:opacity-70"
|
70
53
|
>
|
71
|
-
|
72
|
-
<
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
<
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
className="absolute top-0 -right-4 size-4 fill-none stroke-current stroke-2"
|
54
|
+
Docs
|
55
|
+
<svg
|
56
|
+
xmlns="http://www.w3.org/2000/svg"
|
57
|
+
viewBox="0 0 24 24"
|
58
|
+
strokeLinecap="round"
|
59
|
+
strokeLinejoin="round"
|
60
|
+
className="mb-1.5 size-4 fill-none stroke-current stroke-2"
|
61
|
+
>
|
62
|
+
<path d="M7 7h10v10" />
|
63
|
+
<path d="M7 17 17 7" />
|
64
|
+
</svg>
|
65
|
+
</a>
|
66
|
+
<a
|
67
|
+
href="https://github.com/SlickYeet/create-tnt-stack"
|
68
|
+
target="_blank"
|
69
|
+
rel="noopener noreferrer"
|
70
|
+
className="flex items-center rounded-md border border-white px-2 py-1 outline-none focus:opacity-80 active:opacity-70"
|
89
71
|
>
|
90
|
-
|
91
|
-
<
|
92
|
-
|
93
|
-
|
72
|
+
GitHub
|
73
|
+
<svg
|
74
|
+
xmlns="http://www.w3.org/2000/svg"
|
75
|
+
viewBox="0 0 24 24"
|
76
|
+
strokeLinecap="round"
|
77
|
+
strokeLinejoin="round"
|
78
|
+
className="mb-1.5 size-4 fill-none stroke-current stroke-2"
|
79
|
+
>
|
80
|
+
<path d="M7 7h10v10" />
|
81
|
+
<path d="M7 17 17 7" />
|
82
|
+
</svg>
|
83
|
+
</a>
|
84
|
+
</div>
|
94
85
|
</div>
|
95
86
|
|
96
|
-
<div className="
|
97
|
-
<p>
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
87
|
+
<div className="flex flex-col items-center gap-1 text-sm text-neutral-600 lg:flex-row lg:gap-2 dark:text-neutral-400">
|
88
|
+
<p className="m-0">Get started by editing </p>
|
89
|
+
<a
|
90
|
+
href={fileURL}
|
91
|
+
className="rounded-md bg-neutral-200 px-2 py-1 dark:bg-neutral-800"
|
92
|
+
>
|
93
|
+
<code>src/app/page.tsx</code>
|
94
|
+
</a>
|
103
95
|
</div>
|
104
96
|
</main>
|
105
97
|
)
|
@@ -0,0 +1,126 @@
|
|
1
|
+
import { fileURLToPath } from "url"
|
2
|
+
|
3
|
+
import { auth, signIn, signOut } from "@/server/auth"
|
4
|
+
|
5
|
+
export default async function HomePage() {
|
6
|
+
const session = await auth()
|
7
|
+
const user = session?.user
|
8
|
+
|
9
|
+
const fileURL = `vscode://file/${fileURLToPath(import.meta.url)}`
|
10
|
+
|
11
|
+
return (
|
12
|
+
<main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-[45px]">
|
13
|
+
<header className="ml-auto">
|
14
|
+
{user ? (
|
15
|
+
<button
|
16
|
+
onClick={async () => {
|
17
|
+
"use server"
|
18
|
+
await signOut()
|
19
|
+
}}
|
20
|
+
className="cursor-pointer rounded-md bg-rose-400 px-4 py-2"
|
21
|
+
>
|
22
|
+
Sign Out
|
23
|
+
</button>
|
24
|
+
) : (
|
25
|
+
<button
|
26
|
+
onClick={async () => {
|
27
|
+
"use server"
|
28
|
+
await signIn("discord")
|
29
|
+
}}
|
30
|
+
className="cursor-pointer rounded-md bg-purple-400 px-4 py-2"
|
31
|
+
>
|
32
|
+
Sign In
|
33
|
+
</button>
|
34
|
+
)}
|
35
|
+
</header>
|
36
|
+
|
37
|
+
<div className="flex grow flex-col items-center justify-center">
|
38
|
+
{/* Logo */}
|
39
|
+
<picture className="relative">
|
40
|
+
<div className="absolute inset-0 animate-pulse rounded-xl bg-gradient-to-r from-purple-500 to-cyan-500 opacity-20 blur-xl dark:from-purple-800 dark:to-cyan-800" />
|
41
|
+
<source srcSet="https://github.com/SlickYeet/create-tnt-stack/blob/main/docs/public/logo.light.png?raw=true" />
|
42
|
+
<img
|
43
|
+
src="https://github.com/SlickYeet/create-tnt-stack/blob/main/docs/public/logo.light.png?raw=true"
|
44
|
+
alt="Logo"
|
45
|
+
width={65}
|
46
|
+
height={65}
|
47
|
+
className="block h-auto max-w-full"
|
48
|
+
/>
|
49
|
+
</picture>
|
50
|
+
|
51
|
+
<h1 className="mt-6 bg-gradient-to-r from-purple-500 to-cyan-500 bg-clip-text text-center text-4xl leading-10 text-transparent sm:text-5xl sm:leading-14 md:text-6xl md:leading-20 lg:mt-10 lg:text-7xl lg:font-bold">
|
52
|
+
TNT-Powered Next.js App
|
53
|
+
</h1>
|
54
|
+
<p className="mt-4 text-center text-lg text-neutral-700 md:text-xl lg:mt-6 dark:text-neutral-300">
|
55
|
+
Build modern web applications with today's most popular tools
|
56
|
+
</p>
|
57
|
+
|
58
|
+
<div className="mt-12 flex items-center gap-3">
|
59
|
+
<a
|
60
|
+
href="https://create.tntstack.org"
|
61
|
+
target="_blank"
|
62
|
+
rel="noopener noreferrer"
|
63
|
+
className="flex items-center rounded-md border border-white px-2 py-1 outline-none focus:opacity-80 active:opacity-70"
|
64
|
+
>
|
65
|
+
Website
|
66
|
+
<svg
|
67
|
+
xmlns="http://www.w3.org/2000/svg"
|
68
|
+
viewBox="0 0 24 24"
|
69
|
+
strokeLinecap="round"
|
70
|
+
strokeLinejoin="round"
|
71
|
+
className="mb-1.5 size-4 fill-none stroke-current stroke-2"
|
72
|
+
>
|
73
|
+
<path d="M7 7h10v10" />
|
74
|
+
<path d="M7 17 17 7" />
|
75
|
+
</svg>
|
76
|
+
</a>
|
77
|
+
<a
|
78
|
+
href="https://create.tntstack.org/introduction"
|
79
|
+
target="_blank"
|
80
|
+
rel="noopener noreferrer"
|
81
|
+
className="flex items-center rounded-md border border-white px-2 py-1 outline-none focus:opacity-80 active:opacity-70"
|
82
|
+
>
|
83
|
+
Docs
|
84
|
+
<svg
|
85
|
+
xmlns="http://www.w3.org/2000/svg"
|
86
|
+
viewBox="0 0 24 24"
|
87
|
+
strokeLinecap="round"
|
88
|
+
strokeLinejoin="round"
|
89
|
+
className="mb-1.5 size-4 fill-none stroke-current stroke-2"
|
90
|
+
>
|
91
|
+
<path d="M7 7h10v10" />
|
92
|
+
<path d="M7 17 17 7" />
|
93
|
+
</svg>
|
94
|
+
</a>
|
95
|
+
<a
|
96
|
+
href="https://github.com/SlickYeet/create-tnt-stack"
|
97
|
+
target="_blank"
|
98
|
+
rel="noopener noreferrer"
|
99
|
+
className="flex items-center rounded-md border border-white px-2 py-1 outline-none focus:opacity-80 active:opacity-70"
|
100
|
+
>
|
101
|
+
GitHub
|
102
|
+
<svg
|
103
|
+
xmlns="http://www.w3.org/2000/svg"
|
104
|
+
viewBox="0 0 24 24"
|
105
|
+
strokeLinecap="round"
|
106
|
+
strokeLinejoin="round"
|
107
|
+
className="mb-1.5 size-4 fill-none stroke-current stroke-2"
|
108
|
+
>
|
109
|
+
<path d="M7 7h10v10" />
|
110
|
+
<path d="M7 17 17 7" />
|
111
|
+
</svg>
|
112
|
+
</a>
|
113
|
+
</div>
|
114
|
+
</div>
|
115
|
+
<div className="flex flex-col items-center gap-1 text-sm text-neutral-600 lg:flex-row lg:gap-2 dark:text-neutral-400">
|
116
|
+
<p className="m-0">Get started by editing </p>
|
117
|
+
<a
|
118
|
+
href={fileURL}
|
119
|
+
className="rounded-md bg-neutral-200 px-2 py-1 dark:bg-neutral-800"
|
120
|
+
>
|
121
|
+
<code>src/app/page.tsx</code>
|
122
|
+
</a>
|
123
|
+
</div>
|
124
|
+
</main>
|
125
|
+
)
|
126
|
+
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { fileURLToPath } from "url"
|
2
2
|
import config from "@payload-config"
|
3
3
|
import { headers as getHeaders } from "next/headers.js"
|
4
|
-
import Image from "next/image"
|
5
4
|
import { getPayload } from "payload"
|
6
5
|
|
7
6
|
import "./globals.css"
|
@@ -15,44 +14,123 @@ export default async function HomePage() {
|
|
15
14
|
const fileURL = `vscode://file/${fileURLToPath(import.meta.url)}`
|
16
15
|
|
17
16
|
return (
|
18
|
-
<
|
19
|
-
<div className="
|
20
|
-
|
21
|
-
|
22
|
-
<
|
23
|
-
|
24
|
-
|
25
|
-
src="https://
|
17
|
+
<main className="mx-auto flex h-screen max-w-5xl flex-col items-center justify-between overflow-hidden p-6 sm:p-[45px]">
|
18
|
+
<div className="flex grow flex-col items-center justify-center">
|
19
|
+
{/* Logo */}
|
20
|
+
<picture className="relative">
|
21
|
+
<div className="absolute inset-0 animate-pulse rounded-xl bg-gradient-to-r from-purple-500 to-cyan-500 opacity-20 blur-xl dark:from-purple-800 dark:to-cyan-800" />
|
22
|
+
<source srcSet="https://github.com/SlickYeet/create-tnt-stack/blob/main/docs/public/logo.light.png?raw=true" />
|
23
|
+
<img
|
24
|
+
src="https://github.com/SlickYeet/create-tnt-stack/blob/main/docs/public/logo.light.png?raw=true"
|
25
|
+
alt="Logo"
|
26
26
|
width={65}
|
27
|
+
height={65}
|
28
|
+
className="block h-auto max-w-full"
|
27
29
|
/>
|
28
30
|
</picture>
|
29
|
-
|
30
|
-
{user &&
|
31
|
-
|
31
|
+
|
32
|
+
{!user && (
|
33
|
+
<>
|
34
|
+
<h1 className="mt-6 bg-gradient-to-r from-purple-500 to-cyan-500 bg-clip-text text-center text-4xl leading-10 text-transparent sm:text-5xl sm:leading-14 md:text-6xl md:leading-20 lg:mt-10 lg:text-7xl lg:font-bold">
|
35
|
+
TNT-Powered Next.js App
|
36
|
+
</h1>
|
37
|
+
<p className="mt-4 text-center text-lg text-neutral-700 md:text-xl lg:mt-6 dark:text-neutral-300">
|
38
|
+
Build modern web applications with today's most popular tools
|
39
|
+
</p>
|
40
|
+
</>
|
41
|
+
)}
|
42
|
+
{user && (
|
43
|
+
<h1 className="mt-6 bg-gradient-to-r from-purple-500 to-cyan-500 bg-clip-text text-center text-4xl leading-10 text-transparent sm:text-5xl sm:leading-14 md:text-6xl md:leading-20 lg:mt-10 lg:text-7xl lg:font-bold">
|
44
|
+
Welcome back, {user.email}
|
45
|
+
</h1>
|
46
|
+
)}
|
47
|
+
|
48
|
+
<div className="mt-12 flex items-center gap-3">
|
32
49
|
<a
|
33
|
-
className="admin"
|
34
50
|
href={payloadConfig.routes.admin}
|
35
51
|
rel="noopener noreferrer"
|
36
52
|
target="_blank"
|
53
|
+
className="rounded-md bg-white px-2 py-1 text-black focus:opacity-80 focus:outline-none active:opacity-70 active:outline-none"
|
37
54
|
>
|
38
55
|
Go to admin panel
|
39
56
|
</a>
|
40
57
|
<a
|
41
|
-
className="docs"
|
42
58
|
href="https://payloadcms.com/docs"
|
43
59
|
rel="noopener noreferrer"
|
44
60
|
target="_blank"
|
61
|
+
className="rounded-md border border-white px-2 py-1 text-white focus:opacity-80 focus:outline-none active:opacity-70 active:outline-none"
|
62
|
+
>
|
63
|
+
Payload Docs
|
64
|
+
</a>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
<div className="mt-12 flex items-center gap-3">
|
68
|
+
<a
|
69
|
+
href="https://create.tntstack.org"
|
70
|
+
target="_blank"
|
71
|
+
rel="noopener noreferrer"
|
72
|
+
className="flex items-center rounded-md border border-white px-2 py-1 outline-none focus:opacity-80 active:opacity-70"
|
73
|
+
>
|
74
|
+
Website
|
75
|
+
<svg
|
76
|
+
xmlns="http://www.w3.org/2000/svg"
|
77
|
+
viewBox="0 0 24 24"
|
78
|
+
strokeLinecap="round"
|
79
|
+
strokeLinejoin="round"
|
80
|
+
className="mb-1.5 size-4 fill-none stroke-current stroke-2"
|
81
|
+
>
|
82
|
+
<path d="M7 7h10v10" />
|
83
|
+
<path d="M7 17 17 7" />
|
84
|
+
</svg>
|
85
|
+
</a>
|
86
|
+
<a
|
87
|
+
href="https://create.tntstack.org/introduction"
|
88
|
+
target="_blank"
|
89
|
+
rel="noopener noreferrer"
|
90
|
+
className="flex items-center rounded-md border border-white px-2 py-1 outline-none focus:opacity-80 active:opacity-70"
|
45
91
|
>
|
46
|
-
|
92
|
+
Docs
|
93
|
+
<svg
|
94
|
+
xmlns="http://www.w3.org/2000/svg"
|
95
|
+
viewBox="0 0 24 24"
|
96
|
+
strokeLinecap="round"
|
97
|
+
strokeLinejoin="round"
|
98
|
+
className="mb-1.5 size-4 fill-none stroke-current stroke-2"
|
99
|
+
>
|
100
|
+
<path d="M7 7h10v10" />
|
101
|
+
<path d="M7 17 17 7" />
|
102
|
+
</svg>
|
103
|
+
</a>
|
104
|
+
<a
|
105
|
+
href="https://github.com/SlickYeet/create-tnt-stack"
|
106
|
+
target="_blank"
|
107
|
+
rel="noopener noreferrer"
|
108
|
+
className="flex items-center rounded-md border border-white px-2 py-1 outline-none focus:opacity-80 active:opacity-70"
|
109
|
+
>
|
110
|
+
GitHub
|
111
|
+
<svg
|
112
|
+
xmlns="http://www.w3.org/2000/svg"
|
113
|
+
viewBox="0 0 24 24"
|
114
|
+
strokeLinecap="round"
|
115
|
+
strokeLinejoin="round"
|
116
|
+
className="mb-1.5 size-4 fill-none stroke-current stroke-2"
|
117
|
+
>
|
118
|
+
<path d="M7 7h10v10" />
|
119
|
+
<path d="M7 17 17 7" />
|
120
|
+
</svg>
|
47
121
|
</a>
|
48
122
|
</div>
|
49
123
|
</div>
|
50
|
-
|
51
|
-
|
52
|
-
<
|
53
|
-
|
124
|
+
|
125
|
+
<div className="flex flex-col items-center gap-1 text-sm text-neutral-600 lg:flex-row lg:gap-2 dark:text-neutral-400">
|
126
|
+
<p className="m-0">Get started by editing </p>
|
127
|
+
<a
|
128
|
+
href={fileURL}
|
129
|
+
className="rounded-md bg-neutral-200 px-2 py-1 dark:bg-neutral-800"
|
130
|
+
>
|
131
|
+
<code>src/app/(frontend)/page.tsx</code>
|
54
132
|
</a>
|
55
133
|
</div>
|
56
|
-
</
|
134
|
+
</main>
|
57
135
|
)
|
58
136
|
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { PrismaAdapter } from "@auth/prisma-adapter"
|
2
|
+
import { NextAuthConfig } from "next-auth"
|
3
|
+
import Discord from "next-auth/providers/discord"
|
4
|
+
|
5
|
+
import { env } from "@/env"
|
6
|
+
import { db } from "@/server/db"
|
7
|
+
|
8
|
+
/**
|
9
|
+
* This is the Auth.js configuration for the application.
|
10
|
+
*
|
11
|
+
* @see https://authjs.dev/getting-started/installation
|
12
|
+
*/
|
13
|
+
export const authConfig: NextAuthConfig = {
|
14
|
+
adapter: PrismaAdapter(db),
|
15
|
+
providers: [
|
16
|
+
Discord({
|
17
|
+
clientId: env.DISCORD_CLIENT_ID,
|
18
|
+
clientSecret: env.DISCORD_CLIENT_SECRET,
|
19
|
+
}),
|
20
|
+
/**
|
21
|
+
* ...add more providers here.
|
22
|
+
*
|
23
|
+
* Most other providers require a bit more work than the Discord provider. For example, the
|
24
|
+
* GitHub provider requires you to add the `refresh_token_expires_in` field to the Account
|
25
|
+
* model. Refer to the Auth.js docs for the provider you want to use. Example:
|
26
|
+
*
|
27
|
+
* @see https://authjs.dev/getting-started/providers/github
|
28
|
+
*/
|
29
|
+
],
|
30
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { NextAuthConfig } from "next-auth"
|
2
|
+
import Discord from "next-auth/providers/discord"
|
3
|
+
|
4
|
+
import { env } from "@/env"
|
5
|
+
|
6
|
+
/**
|
7
|
+
* This is the Auth.js configuration for the application.
|
8
|
+
*
|
9
|
+
* @see https://authjs.dev/getting-started/installation
|
10
|
+
*/
|
11
|
+
export const authConfig: NextAuthConfig = {
|
12
|
+
providers: [
|
13
|
+
Discord({
|
14
|
+
clientId: env.DISCORD_CLIENT_ID,
|
15
|
+
clientSecret: env.DISCORD_CLIENT_SECRET,
|
16
|
+
}),
|
17
|
+
/**
|
18
|
+
* ...add more providers here.
|
19
|
+
*
|
20
|
+
* Most other providers require a bit more work than the Discord provider. For example, the
|
21
|
+
* GitHub provider requires you to add the `refresh_token_expires_in` field to the Account
|
22
|
+
* model. Refer to the Auth.js docs for the provider you want to use. Example:
|
23
|
+
*
|
24
|
+
* @see https://authjs.dev/getting-started/providers/github
|
25
|
+
*/
|
26
|
+
],
|
27
|
+
}
|