From 615170dc340f62d5601e659edabaac63c0befded Mon Sep 17 00:00:00 2001 From: Patrick Arminio Date: Fri, 12 Apr 2024 17:50:14 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Mark=20login=20field=20as=20requ?= =?UTF-8?q?ired=20(#1166)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/hooks/useAuth.ts | 4 ++++ frontend/src/routes/login.tsx | 2 ++ 2 files changed, 6 insertions(+) diff --git a/frontend/src/hooks/useAuth.ts b/frontend/src/hooks/useAuth.ts index 58d8db7..397e408 100644 --- a/frontend/src/hooks/useAuth.ts +++ b/frontend/src/hooks/useAuth.ts @@ -43,6 +43,10 @@ const useAuth = () => { errDetail = err.message } + if (Array.isArray(errDetail)) { + errDetail = "Something went wrong" + } + setError(errDetail) }, }) diff --git a/frontend/src/routes/login.tsx b/frontend/src/routes/login.tsx index 55db35f..b2ee1f6 100644 --- a/frontend/src/routes/login.tsx +++ b/frontend/src/routes/login.tsx @@ -92,6 +92,7 @@ function Login() { })} placeholder="Email" type="email" + required /> {errors.username && ( {errors.username.message} @@ -103,6 +104,7 @@ function Login() { {...register("password")} type={show ? "text" : "password"} placeholder="Password" + required />