admin / Synapse-Sonar
publicAttack Surface Simulation
Synapse-Sonar / synapse-sonar / app / (app) / profile / page.tsx
1127 B · main
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 | import { getServerSession } from "next-auth"; import { authOptions } from "@/lib/authOptions"; import { prisma } from "@/lib/prisma"; import MfaEnrollment from "@/components/MfaEnrollment"; export const dynamic = "force-dynamic"; export default async function ProfilePage() { const session = await getServerSession(authOptions); let mfaEnabled = false; if (session?.user?.id) { const user = await prisma.user.findUnique({ where: { id: session.user.id }, select: { mfaEnabled: true }, }); mfaEnabled = user?.mfaEnabled ?? false; } return ( <div className="min-h-screen bg-[#05080f] px-8 py-10"> <div className="mx-auto max-w-2xl space-y-6"> <header> <h1 className="text-2xl font-semibold text-slate-100">Profile & Security</h1> <p className="mt-1 text-sm text-slate-400"> Signed in as{" "} <span className="font-mono text-synapse-cyan">{session?.user?.username}</span> ·{" "} {session?.user?.role} </p> </header> <MfaEnrollment initialEnabled={mfaEnabled} /> </div> </div> ); } |