I get this error when I deploy a nextjs app in vercel.in dev mode every thing works fine but when I deploy my app in vercel I got this error.
This error probably come from next-auth, but I don't no why this show up.
My code in [...nextauth].js:
export default NextAuth({
session: {
maxAge: 30 * 24 * 60 * 60,
jwt: true,
updateAge: 24 * 60 * 60
},
providers: [
Providers.Credentials({
async authorize(credentials) {
try {
await dbConnect();
const findUser = await User.findOne({ email: credentials.email });
if (!findUser) {
throw new Error('User not found.');
}
const comparePass = await comparePassword(credentials.password, findUser.password);
if (!comparePass) {
throw new Error('Confirm password not match.');
}
return { email: credentials.email, isAdmin: findUser.isAdmin };
} catch (error) {
throw new Error(error.message);
}
}
})
]});
This error will come when a request to /api/auth/session and /api/auth/_log
I'm glad for anyone can help me.
