From de3d99a3b1a398ae01eec0f65f03309648cbe24d Mon Sep 17 00:00:00 2001 From: Dionizio Ferreira Date: Sat, 6 Dec 2025 07:35:25 -0300 Subject: [PATCH] fix: add error handling for internal server error in login form --- components/auth/login-form.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/auth/login-form.tsx b/components/auth/login-form.tsx index a84dc7f..0f24d14 100644 --- a/components/auth/login-form.tsx +++ b/components/auth/login-form.tsx @@ -55,6 +55,11 @@ export function LoginForm({ className, ...props }: DivProps) { router.replace("/dashboard"); }, 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); setLoadingEmail(false); },