Credentials({
credentials: {
email: {},
password: {},
},
authorize: async (credentials) => {
let user = null;
if (someLogic) {
throw new Error("User not found.");
}
return user;
},
}),
Client page –
const res = await signIn("credentials", {
email,
password: pass,
redirect: false,
});
How can I show custom error messages to users without reloading sign-in page. I didn’t get any errors in older next auth versions.