build fix

This commit is contained in:
alma 2025-05-05 19:13:57 +02:00
parent e280e2bce1
commit bafea2c986

View File

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