From 3f11183768383c51e29751b14b719627986e1b61 Mon Sep 17 00:00:00 2001 From: Prateek Shourya Date: Tue, 25 Nov 2025 23:59:21 +0530 Subject: [PATCH] [WEB-5508] fix: improve error handling in AuthFormRoot by ensuring safe access to error_code (#8178) --- apps/web/core/components/account/auth-forms/form-root.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/core/components/account/auth-forms/form-root.tsx b/apps/web/core/components/account/auth-forms/form-root.tsx index 4eacb4704..35ad625cb 100644 --- a/apps/web/core/components/account/auth-forms/form-root.tsx +++ b/apps/web/core/components/account/auth-forms/form-root.tsx @@ -91,7 +91,7 @@ export const AuthFormRoot = observer(function AuthFormRoot(props: TAuthFormRoot) .generateUniqueCode(payload) .then(() => ({ code: "" })) .catch((error) => { - const errorhandler = authErrorHandler(error?.error_code.toString()); + const errorhandler = authErrorHandler(error?.error_code?.toString()); if (errorhandler?.type) setErrorInfo(errorhandler); throw error; });