Files
HooHacks-12/React/src/app/auth/session/route.ts
2025-03-30 03:43:08 -04:00

13 lines
349 B
TypeScript

import { NextResponse } from "next/server";
import { auth0 } from "../../../lib/auth0";
export async function GET() {
try {
const session = await auth0.getSession();
return NextResponse.json({ session });
} catch (error) {
console.error("Error getting session:", error);
return NextResponse.json({ session: null }, { status: 500 });
}
}