build fix
This commit is contained in:
parent
e280e2bce1
commit
bafea2c986
22
lib/auth.ts
22
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
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user