fix: add error handling for internal server error in login form
This commit is contained in:
@@ -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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user