Files
shared-memory/apps/web/app/me/page.tsx
T

32 lines
755 B
TypeScript
Raw Normal View History

import { redirect } from "next/navigation";
import { auth, signOut } from "@/auth";
export const dynamic = "force-dynamic";
export default async function MePage() {
const session = await auth();
if (!session?.user) {
redirect("/api/auth/signin");
}
return (
<main className="container">
<h1>Signed in</h1>
<p className="muted">
Debug view confirms the Authentik round-trip and the OIDC claims we
received.
</p>
<h2>Session</h2>
<pre>{JSON.stringify(session, null, 2)}</pre>
<form
action={async () => {
"use server";
await signOut({ redirectTo: "/" });
}}
>
<button type="submit">Sign out</button>
</form>
</main>
);
}