From 555468eec0563b3ff7b8662f91bc222f6ea85095 Mon Sep 17 00:00:00 2001 From: Piyush Gupta Date: Thu, 9 Oct 2025 01:59:05 +0530 Subject: [PATCH] fix: improved fallback checking --- frontend/src/components/auth/EnterEmailStep.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/auth/EnterEmailStep.tsx b/frontend/src/components/auth/EnterEmailStep.tsx index 55988818f..4bdf10dc6 100644 --- a/frontend/src/components/auth/EnterEmailStep.tsx +++ b/frontend/src/components/auth/EnterEmailStep.tsx @@ -54,11 +54,10 @@ export default function EnterEmailStep({ incrementStep(); } catch (e) { if (axios.isAxiosError(e)) { - let message = "Something went wrong"; - if (e?.status === 422) { - message = "Invalid email"; - } else { - message = (e.response?.data as { message: string })?.message || message; + let { message } = e.response?.data as { message: string }; + + if (typeof message !== "string") { + message = "Something went wrong"; } createNotification({