11 lines
348 B
TypeScript
11 lines
348 B
TypeScript
import { NextResponse } from "next/server";
|
|
import { getServerSession } from "@/lib/auth";
|
|
|
|
export async function GET() {
|
|
const session = await getServerSession();
|
|
if (!session) {
|
|
return NextResponse.json({ user: null });
|
|
}
|
|
return NextResponse.json({ user: { id: session.id, nickname: session.nickname, isAdmin: session.isAdmin } });
|
|
}
|