fp/services/next/app/api/session/route.ts

13 lines
319 B
TypeScript
Raw Normal View History

2024-12-12 07:23:46 +00:00
import { getServerSession } from "next-auth";
import { authOptions } from "@/app/lib/auth";
import { NextResponse } from "next/server";
export async function GET(request: Request) {
const session = await getServerSession(authOptions);
return NextResponse.json({
authenticated: !!session,
session,
});
}