forked from nextauthjs/next-auth-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage.tsx
38 lines (36 loc) · 1.32 KB
/
page.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import CustomLink from "@/components/custom-link"
import { auth } from "auth"
export default async function Index() {
const session = await auth()
return (
<div className="flex flex-col gap-6">
<h1 className="text-3xl font-bold">NextAuth.js Example</h1>
<div>
This is an example site to demonstrate how to use{" "}
<CustomLink href="https://nextjs.authjs.dev">NextAuth.js</CustomLink>{" "}
for authentication. Check out the{" "}
<CustomLink href="/server-example" className="underline">
Server
</CustomLink>{" "}
and the{" "}
<CustomLink href="/client-example" className="underline">
Client
</CustomLink>{" "}
examples to see how to secure pages and get session data.
</div>
<div>
WebAuthn users are reset on every deploy, don't expect your test user(s)
to still be available after a few days. It is designed to only
demonstrate registration, login, and logout briefly.
</div>
<div className="flex flex-col bg-gray-100 rounded-md">
<div className="p-4 font-bold bg-gray-200 rounded-t-md">
Current Session
</div>
<pre className="py-6 px-4 whitespace-pre-wrap break-all">
{JSON.stringify(session, null, 2)}
</pre>
</div>
</div>
)
}