i am using nextauth v:4.7.0, i didnt have a client secret and local environment worked well, after deploying to vercel, i was forced to provide a secret, from the code below
export default NextAuth({
session: {
// jwt: true,
strategy: "jwt"
},
providers: [..my credentials ],
secret: process.env.NEXTAUTH_SECRET,
jwt: {
secret: process.env.NEXTAUTH_SECRET,
encryption: true
}
});
but after doing this, i am getting this error both in production and development
error: {
message: 'invalid json response body at http://localhost:3000/auth/session reason: Unexpected token < in JSON at position 0',
stack: 'FetchError: invalid json response body at http://localhost:3000/auth/session reason: Unexpected token < in JSON at position 0\n' +
' at D:\\projects\\deployed\\booking-portal\\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',
header: {
host: 'localhost:3000',
```
i dont know what it means, please help