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

This commit is contained in:
Prateek Shourya 2025-11-25 23:59:21 +05:30 committed by GitHub
parent d38147b875
commit 3f11183768
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -91,7 +91,7 @@ export const AuthFormRoot = observer(function AuthFormRoot(props: TAuthFormRoot)
.generateUniqueCode(payload) .generateUniqueCode(payload)
.then(() => ({ code: "" })) .then(() => ({ code: "" }))
.catch((error) => { .catch((error) => {
const errorhandler = authErrorHandler(error?.error_code.toString()); const errorhandler = authErrorHandler(error?.error_code?.toString());
if (errorhandler?.type) setErrorInfo(errorhandler); if (errorhandler?.type) setErrorInfo(errorhandler);
throw error; throw error;
}); });