I am getting this error. https://next-auth.js.org/errors#oauth_callback_error expected 200 OK, got: 400 Bad Request
Please help me solve it.
THis is my next auth config
const authHandler: NextApiHandler = (req, res) => NextAuth(req, res, options)
export default authHandler
const options: NextAuthOptions = {
providers: [
FacebookProvider({
clientId: process.env.FACEBOOK_CLIENT_ID,
clientSecret: process.env.FACEBOOK_CLIENT_SECRET,
}),
],
callbacks: {
async session({ session, token }) {
if (session?.user) {
session.user.id = token.id
session.user.createdAt = token.createdAt
session.user.role = token.role
}
return session
},
async jwt({ user, token }) {
if (user) {
token.id = user.id
// @ts-ignore
token.createdAt = user.createdAt
// @ts-ignore
token.role = user.role
}
return token
},
},
session: {
strategy: 'jwt',
},
adapter: PrismaAdapter(prisma),
secret: process.env.NEXTAUTH_SECRET,
}
]1