import { handler, json } from "@/lib/server/api"; import { currentSession } from "@/lib/server/session"; export const runtime = "nodejs"; export const GET = handler(async () => { const s = await currentSession(); if (!s) return json({ authenticated: false }, { status: 401 }); return json({ authenticated: true, username: s.username, mustChangePassword: s.mustChangePassword, csrfToken: s.csrfToken, expiresAt: s.expiresAt.toISOString(), }); });