From e6fb7cdb19d84a6babe6ba31ade2f62c194a1e67 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Sun, 27 Jul 2025 22:01:51 +0200 Subject: [PATCH] Clean session names --- app/api/auth/[...nextauth]/route.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/api/auth/[...nextauth]/route.ts b/app/api/auth/[...nextauth]/route.ts index 89bc75c1..69677e0e 100644 --- a/app/api/auth/[...nextauth]/route.ts +++ b/app/api/auth/[...nextauth]/route.ts @@ -69,7 +69,7 @@ export const authOptions: NextAuthOptions = { async session({session, token}) { if (token && session.user) { session.user.id = token.id as string; - session.user.name = token.name; + session.user.name = token.name as string; session.user.email = token.email as string; session.user.image = token.picture as string; } @@ -85,18 +85,12 @@ export const authOptions: NextAuthOptions = { debug: process.env.NODE_ENV === "development", } satisfies NextAuthOptions; -// Export **named** HTTP handlers (required by App Router) -console.log("Auth route hit"); - -// export const { handlers, auth, signIn, signOut } = NextAuth(authOptions); const authHandler = NextAuth(authOptions); -// export const GET = handlers.GET; -// export const POST = handlers.POST; export {authHandler as GET, authHandler as POST}; declare module "next-auth" { interface Session { - user: { id: string; name: string; email: string }; + user: { id: string; name: string; email: string ; image: string }; } }