User is able to redirect to / with wrong credentials or without credentials
This is the login function
const login = useCallback(async () => {
try {
await signIn("credentials", {
email,
password,
redirect: false,
callbackUrl: "/",
});
router.push("/");
} catch (error) {
console.log(error);
}
}, [email, name, password, router]);
How can we make sure the line router.push is not called if we have an error in the signIn function
User is able to redirect to / with wrong credentials or without credentials
This is the login function
How can we make sure the line router.push is not called if we have an error in the signIn function