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 }; } })