Skip to content

Commit

Permalink
hotfix: return user-friendly error on sing-in page (#5687)
Browse files Browse the repository at this point in the history
* hotfix: return user-friendly error on sing-in page

* hotfix: return user-friendly error on sing-in page

(cherry picked from commit d1fc830)
  • Loading branch information
SavelevMatthew committed Jan 13, 2025
1 parent e02e454 commit cab9a2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apps/callcenter
10 changes: 3 additions & 7 deletions apps/condo/domains/user/components/auth/SignInForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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],
},
}
Expand Down

0 comments on commit cab9a2f

Please sign in to comment.