login toast fix

This commit is contained in:
Timur Ercan
2023-01-14 18:47:19 +01:00
parent 39503b4ad7
commit 40475b144f

View File

@ -53,6 +53,7 @@ export default function Login() {
); );
if (!res) { if (!res) {
setErrorMessage("error"); setErrorMessage("error");
toast.dismiss();
toast.error("Something went wrong."); toast.error("Something went wrong.");
} }
// we're logged in! let's do a hard refresh to the desired url // we're logged in! let's do a hard refresh to the desired url
@ -62,6 +63,7 @@ export default function Login() {
} }
// fallback if error not found // fallback if error not found
else { else {
toast.dismiss();
if (res.status == 401) { if (res.status == 401) {
toast.error("Invalid email or password."); toast.error("Invalid email or password.");
} else { } else {