providers: [
CredentialsProvider({
id: 'credentials',
name: 'Credentials',
// @ts-ignore
async authorize(credentials: any) {
const user = await prisma.user.findUnique({
where: { email: credentials.email },
});
if (!user) {
return null;
}
const passwordMatch = await compare(credentials.password, user.password);
if (!passwordMatch) {
return null;
}
return {
id: user.id,
name: user.name,
email: user.email,
}
},
}),
],
providers: [
CredentialsProvider({
id: 'credentials',
name: 'Credentials',
// @ts-ignore
async authorize(credentials: any) {
const user = await prisma.user.findUnique({
where: { email: credentials.email },
});
if (!user) {
return null;
}
const passwordMatch = await compare(credentials.password, user.password);
if (!passwordMatch) {
return null;
}
return {
id: user.id,
name: user.name,
email: user.email,
}
},
}),
],