diff options
Diffstat (limited to 'communities/174bg/174bg.net/src/app/secure')
| -rw-r--r-- | communities/174bg/174bg.net/src/app/secure/discord-data/page.js | 24 | ||||
| -rw-r--r-- | communities/174bg/174bg.net/src/app/secure/page.js | 13 |
2 files changed, 37 insertions, 0 deletions
diff --git a/communities/174bg/174bg.net/src/app/secure/discord-data/page.js b/communities/174bg/174bg.net/src/app/secure/discord-data/page.js new file mode 100644 index 0000000..b906569 --- /dev/null +++ b/communities/174bg/174bg.net/src/app/secure/discord-data/page.js @@ -0,0 +1,24 @@ +import { auth } from "@/auth"; +import { headers } from "next/headers"; + +export default async function DiscordData() { + const session = await auth.api.getSession({ headers: await headers() }); + const accounts = await auth.api.listUserAccounts({ + headers: await headers(), + }); + const discordAccount = accounts?.find((a) => a.provider === "discord"); + + return ( + <main> + <h1>Discord Data</h1> + <p>The following data is stored about your Discord account:</p> + <pre> + {JSON.stringify( + { user: session?.user, account: discordAccount }, + null, + 2, + )} + </pre> + </main> + ); +} diff --git a/communities/174bg/174bg.net/src/app/secure/page.js b/communities/174bg/174bg.net/src/app/secure/page.js new file mode 100644 index 0000000..27312b7 --- /dev/null +++ b/communities/174bg/174bg.net/src/app/secure/page.js @@ -0,0 +1,13 @@ +import { auth } from "@/auth"; +import { headers } from "next/headers"; + +export default async function SecurePage() { + const session = await auth.api.getSession({ headers: await headers() }); + + return ( + <main> + <h1>Secure Area</h1> + <p>Welcome, {session?.user?.name ?? session?.user?.email}!</p> + </main> + ); +} |
