From cab9a2f040adf19acf8e5f0e1a928b843c4b5723 Mon Sep 17 00:00:00 2001 From: Matthew <50069872+SavelevMatthew@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:43:02 +0500 Subject: [PATCH] hotfix: return user-friendly error on sing-in page (#5687) * hotfix: return user-friendly error on sing-in page * hotfix: return user-friendly error on sing-in page (cherry picked from commit d1fc830748c9f7cef3ab1997c4d028e18fe07cd5) --- apps/callcenter | 2 +- apps/condo/domains/user/components/auth/SignInForm.tsx | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/callcenter b/apps/callcenter index 33d2e4bd65c..5eb6ea499f3 160000 --- a/apps/callcenter +++ b/apps/callcenter @@ -1 +1 @@ -Subproject commit 33d2e4bd65c0ab0f911a0d75d3de931b82344f68 +Subproject commit 5eb6ea499f33f0b95a31a73f13178650d1fd906a diff --git a/apps/condo/domains/user/components/auth/SignInForm.tsx b/apps/condo/domains/user/components/auth/SignInForm.tsx index e73cc6613c2..3628f8d90d1 100644 --- a/apps/condo/domains/user/components/auth/SignInForm.tsx +++ b/apps/condo/domains/user/components/auth/SignInForm.tsx @@ -16,7 +16,7 @@ import { colors } from '@condo/domains/common/constants/style' import { runMutation } from '@condo/domains/common/utils/mutations.utils' import { isSafeUrl } from '@condo/domains/common/utils/url.utils' import { ResponsiveCol } from '@condo/domains/user/components/containers/ResponsiveCol' -import { WRONG_PASSWORD_ERROR, WRONG_PHONE_ERROR } from '@condo/domains/user/constants/errors' +import { WRONG_CREDENTIALS } from '@condo/domains/user/constants/errors' import { SIGNIN_BY_PHONE_AND_PASSWORD_MUTATION } from '@condo/domains/user/gql' import { AgreementText } from './AgreementText' @@ -58,12 +58,8 @@ export const SignInForm = (): React.ReactElement => { // TODO(DOMA-3293): remove this legacy error style and Useless error messages const ErrorToFormFieldMsgMapping = useMemo(() => { return { - [WRONG_PHONE_ERROR]: { - name: 'signinError', - errors: [PasswordOrPhoneMismatch], - }, - [WRONG_PASSWORD_ERROR]: { - name: 'signinError', + [WRONG_CREDENTIALS]: { + name: 'phone', errors: [PasswordOrPhoneMismatch], }, }