diff --git a/frontend/src/app/api/auth/[...nextauth]/route.ts b/frontend/src/app/api/auth/[...nextauth]/route.ts index a96a6c4a..5b06232e 100644 --- a/frontend/src/app/api/auth/[...nextauth]/route.ts +++ b/frontend/src/app/api/auth/[...nextauth]/route.ts @@ -1,4 +1,4 @@ -import { AuthOptions, getServerSession, Session } from "next-auth"; +import NextAuth, { AuthOptions, getServerSession, Session } from "next-auth"; import AzureADProvider from "next-auth/providers/azure-ad"; export type CustomSession = { @@ -49,6 +49,10 @@ export const authOptions: AuthOptions = { }, }; +const handler = NextAuth(authOptions); + export async function getCustomServerSession(authOptions: AuthOptions) { return (await getServerSession(authOptions)) as CustomSession; } + +export { handler as GET, handler as POST };