'use server'; import { NextResponse } from "next/server"; import { getServerSession } from "next-auth"; import { authOptions } from "@/app/lib/auth"; export async function GET() { const session = await getServerSession(authOptions); if (session) { return NextResponse.json(session) } return NextResponse.json({ error: "You must be logged in." }, { status: 401 }); }