Authentication API Not returning correct response

System Information
  • Strapi Version: 4.9.1
  • Operating System: MacOs
  • Database: Local postgres

I have been trying to get strapi set up with NextAuth, but strapi doesn’t seem to be returning a readable response.body when provided with the correct user credentials? It returns a status 200 but not the response required. The code I am using is:

export default async function signIn({ email, password }: any) {
const res = await fetch(
${process.env.NEXT_PUBLIC_STRAPI_BASE_URL}/auth/local,
{
method: “POST”,
headers: {
“Content-Type”: “application/json”,
},
body: JSON.stringify({
identifier: email,
password,
}),
}
);
console.log(res);
return res.body;
}