login(username, password) how do i handle error when authentication fails
login(username, password)
.then(() => {
setErrorMsg("");
history.push("/explore");
})
.catch((err) => {
console.error("Error signing in.", err);
setErrorMsg(err.toString());
});
i’ve got this right now but the catch block isn’t called when i enter wrong username/password