I have an e-commerce that I deploy into vercel, I used next-auth for authentication, when i try to login it's complains and launch an error
[nextauth].ts
export default NextAuth({
providers: [
Credentials({
name: "Custom Login",
credentials: {
email: {
label: "Correo:",
type: "email",
placeholder: "correo@google.com",
},
password: {
label: "Contraseña:",
type: "password",
placeholder: "Contraseña",
},
},
async authorize(credentials) {
console.log({ credentials });
return await dbUsers.checkUserEmailPassword(
credentials!.email,
credentials!.password
);
},
}),
login.tsx
const onLoginUser = async ({ email, password }: FormData) => {
setShowError(false);
await signIn("credentials", { email, password });
};
this is my response:
[![2022-06-23T08:45:36.199Z 33d4ff25-ada2-4054-9050-68eec5626886 ERROR \[next-auth\]\[error\]\[CLIENT_FETCH_ERROR\]
https://next-auth.js.org/errors#client_fetch_error invalid json response body at https://madrugon-8dxawm6jh-madrugon-admin.vercel.app/api/auth/session reason: Unexpected token < in JSON at position 0 {
error: {
message: 'invalid json response body at https://madrugon-8dxawm6jh-madrugon-admin.vercel.app/api/auth/session reason: Unexpected token < in JSON at position 0',
stack: 'FetchError: invalid json response body at https://madrugon-8dxawm6jh-madrugon-admin.vercel.app/api/auth/session reason: Unexpected token < in JSON at position 0\n' +
' at /var/task/node_modules/next/dist/compiled/node-fetch/index.js:1:49606\n' +
' at processTicksAndRejections (node:internal/process/task_queues:96:5)',
name: 'FetchError'
},
path: 'session',][1]][1]
in heroku and locally works perfect but not in custom domain in vercel ¿can you help me?
I have reviewed and it seems that one of my problems is that the providers are not read