Your Name 366e0e3e5c
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
feat: enforce single active session per account
2026-04-03 17:43:03 +08:00

19 lines
388 B
TypeScript

import { NextResponse } from "next/server";
import { auth } from "@/app/(auth)/auth";
export async function GET() {
const session = await auth().catch(() => null);
return NextResponse.json(
{
valid: Boolean(session?.user?.id),
userType: session?.user?.type ?? null,
},
{
headers: {
"Cache-Control": "no-store, max-age=0",
},
}
);
}