From 97b99c7fdd652b2051031569bf51ec5fd0e1aba2 Mon Sep 17 00:00:00 2001 From: JATIN Date: Mon, 28 Apr 2025 19:20:45 +0530 Subject: [PATCH] Fixing Incorrect login error message --- client/utils/reduxFormUtils.js | 4 ++-- translations/locales/en-US/translations.json | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/utils/reduxFormUtils.js b/client/utils/reduxFormUtils.js index cb2d88b495..085e37cae7 100644 --- a/client/utils/reduxFormUtils.js +++ b/client/utils/reduxFormUtils.js @@ -62,8 +62,8 @@ export function validateSettings(formProps) { export function validateLogin(formProps) { const errors = {}; - if (!formProps.email) { - errors.email = i18n.t('ReduxFormUtils.errorEmptyEmail'); + if (!formProps.email && !formProps.username) { + errors.email = i18n.t('ReduxFormUtils.errorEmptyEmailorUserName'); } if (!formProps.password) { errors.password = i18n.t('ReduxFormUtils.errorEmptyPassword'); diff --git a/translations/locales/en-US/translations.json b/translations/locales/en-US/translations.json index 5abbb3c3aa..59e6bcbaad 100644 --- a/translations/locales/en-US/translations.json +++ b/translations/locales/en-US/translations.json @@ -334,6 +334,7 @@ "ReduxFormUtils": { "errorInvalidEmail": "Please enter a valid email address", "errorEmptyEmail": "Please enter an email", + "errorEmptyEmailorUserName": "Please enter an email or username", "errorPasswordMismatch": "Passwords must match", "errorEmptyPassword": "Please enter a password", "errorShortPassword": "Password must be at least 6 characters",