From bafea2c986e5eaefeac0b0e36bf475ce790a6fc3 Mon Sep 17 00:00:00 2001 From: alma Date: Mon, 5 May 2025 19:13:57 +0200 Subject: [PATCH] build fix --- lib/auth.ts | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/lib/auth.ts b/lib/auth.ts index 8f89594f..092a36e9 100644 --- a/lib/auth.ts +++ b/lib/auth.ts @@ -2,18 +2,8 @@ import { NextAuthOptions } from 'next-auth'; import CredentialsProvider from 'next-auth/providers/credentials'; import { prisma } from '@/lib/prisma'; -// Extend the built-in User type -declare module "next-auth" { - interface User { - id: string; - email: string; - name?: string; - } - - interface Session { - user: User; - } -} +// We don't need to extend User or Session here as they're defined in types/next-auth.d.ts +// Removing the conflicting declarations export const authOptions: NextAuthOptions = { providers: [ @@ -46,10 +36,16 @@ export const authOptions: NextAuthOptions = { return null; } + // Return a user object compatible with the User interface in types/next-auth.d.ts return { id: user.id, email: user.email, - name: user.email.split('@')[0] + name: user.email.split('@')[0], + first_name: '', + last_name: '', + username: user.email.split('@')[0], + role: ['user'], + image: null }; } })