import { authOptions } from "@/src/pages/api/auth/[...nextauth]";
import { unstable_getServerSession } from "next-auth/next";
export default async function DashboardPage() {
const session = await unstable_getServerSession(authOptions);
if (!session) {
// return redirect to login or whatever
}
return (
<>
<main className=" z-10 flex h-screen w-screen flex-col items-center justify-center">
<h1>we have session</h1>
</main>
</>
);
}
import { authOptions } from "@/src/pages/api/auth/[...nextauth]";
import { unstable_getServerSession } from "next-auth/next";
export default async function DashboardPage() {
const session = await unstable_getServerSession(authOptions);
if (!session) {
// return redirect to login or whatever
}
return (
<>
<main className=" z-10 flex h-screen w-screen flex-col items-center justify-center">
<h1>we have session</h1>
</main>
</>
);
}