Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

[WEB-5508] fix: improve error handling in AuthFormRoot by ensuring safe access to error_code (#8178)

Prateek Shourya3f1118376838
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 4eacb4704a..35ad625cbb 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;
});