fix: add error handling for internal server error in login form

This commit is contained in:
Dionizio Ferreira
2025-12-06 07:35:25 -03:00
parent e50b0d1532
commit de3d99a3b1

View File

@@ -55,6 +55,11 @@ export function LoginForm({ className, ...props }: DivProps) {
router.replace("/dashboard"); router.replace("/dashboard");
}, },
onError: (ctx) => { onError: (ctx) => {
if (ctx.error.status === 500 && ctx.error.statusText === "Internal Server Error") {
toast.error("Ocorreu uma falha na requisição. Tente novamente mais tarde.");
}
setError(ctx.error.message); setError(ctx.error.message);
setLoadingEmail(false); setLoadingEmail(false);
}, },