Skip to content

error added that the new password entered should be different from the current password #3013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions client/utils/reduxFormUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ export const domOnlyProps = ({
visited,
autofilled,
error,
...domProps }) => domProps;
...domProps
}) => domProps;
/* eslint-enable */

/* eslint-disable */
const EMAIL_REGEX =
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i;
const EMAIL_REGEX = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i;
/* eslint-enable */

function validateNameEmail(formProps, errors) {
Expand Down Expand Up @@ -51,6 +51,9 @@ export function validateSettings(formProps) {
if (formProps.newPassword && formProps.newPassword.length < 6) {
errors.newPassword = i18n.t('ReduxFormUtils.errorShortPassword');
}
if (formProps.currentPassword === formProps.newPassword) {
errors.newPassword = i18n.t('ReduxFormUtils.errorNewPasswordRepeat');
}
return errors;
}

Expand Down
1 change: 1 addition & 0 deletions translations/locales/be/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@
"errorShortPassword": "পাসওয়ার্ডটি কমপক্ষে 6 টি অক্ষর হতে হবে",
"errorConfirmPassword": "আপনার পাসওয়ার্ড নিশ্চিত করুন",
"errorNewPassword": "দয়া করে একটি নতুন পাসওয়ার্ড লিখুন বা বর্তমান পাসওয়ার্ডটি ফাঁকা রাখুন।",
"errorNewPasswordRepeat":"Your New Password must differ from the current one.",
"errorEmptyUsername": "দয়া করে একটি ইউজারনেম লিখুন",
"errorLongUsername": "ইউজারনেম সর্বাধিক 20 অক্ষর হতে হবে",
"errorValidUsername": "ইউজারনেম কেবলমাত্র সংখ্যা, অক্ষর, দোতলা, ড্যাশ, এবং আন্ডারস্কোর থাকতে পারে"
Expand Down
1 change: 1 addition & 0 deletions translations/locales/de/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@
"errorEmptyPassword": "Gib bitte ein Passwort ein",
"errorShortPassword": "Das Passwort muss mindestens aus 6 Zeichen bestehen",
"errorConfirmPassword": "Gib bitte das Passwort erneut ein",
"errorNewPasswordRepeat":"Your New Password must differ from the current one.",
"errorNewPassword": "Gib bitte ein neues Passwort ein oder lass dieses Feld frei.",
"errorEmptyUsername": "Gib bitte einen Nutzernamen ein.",
"errorLongUsername": "Der Nutzername muss weniger als 20 Zeichen haben.",
Expand Down
1 change: 1 addition & 0 deletions translations/locales/en-US/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@
"errorShortPassword": "Password must be at least 6 characters",
"errorConfirmPassword": "Please confirm your password",
"errorNewPassword": "Please enter a new password or leave the current password empty.",
"errorNewPasswordRepeat":"Your New Password must differ from the current one.",
"errorEmptyUsername": "Please enter a username.",
"errorLongUsername": "Username must be less than 20 characters.",
"errorValidUsername": "Username must only consist of numbers, letters, periods, dashes, and underscores."
Expand Down
1 change: 1 addition & 0 deletions translations/locales/es-419/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@
"errorShortPassword": "La contraseña debe tener al menos 6 caracteres",
"errorConfirmPassword": "Por favor confirma una contraseña",
"errorNewPassword": "Por favor introduce una nueva contraseña o deja la actual contraseña vacía",
"errorNewPasswordRepeat":"Your New Password must differ from the current one.",
"errorEmptyUsername": "Por favor introduce tu identificación",
"errorLongUsername": "La identificación debe ser menor a 20 caracteres.",
"errorValidUsername": "La identificación debe consistir solamente de números, letras, puntos, guiones y guiones bajos."
Expand Down
1 change: 1 addition & 0 deletions translations/locales/fr-CA/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
"errorEmptyPassword": "Veuillez saisir un mot de passe",
"errorShortPassword": "Le mot de passe doit comporter au moins 6 caractères",
"errorConfirmPassword": "Veuillez saisir une confirmation de mot de passe",
"errorNewPasswordRepeat":"Your New Password must differ from the current one.",
"errorNewPassword": "Veuillez saisir un nouveau mot de passe ou laisser le mot de passe actuel vide.",
"errorEmptyUsername": "Veuillez saisir un nom d'utilisateur.",
"errorLongUsername": "Le nom d'utilisateur doit comporter moins de 20 caractères.",
Expand Down
4 changes: 3 additions & 1 deletion translations/locales/hi/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@
"errorNewPassword": "कृपया एक नया पासवर्ड दर्ज करें या वर्तमान पासवर्ड को खाली छोड़ दें।",
"errorEmptyUsername": "कृपया यूजरनेम लिखें",
"errorLongUsername": "यूजरनेम २० अक्षरों से कम होना चाहिए।",
"errorValidUsername": "यूजरनेम में केवल संख्या, अक्षर, पिरीअड्, डैश और अंडरस्कोर शामिल होना चाहिए।"
"errorValidUsername": "यूजरनेम में केवल संख्या, अक्षर, पिरीअड्, डैश और अंडरस्कोर शामिल होना चाहिए।",
"errorNewPasswordRepeat":"नया पासवर्ड वर्तमान पासवर्ड से भिन्न होना चाहिए।."

},
"NewPasswordView": {
"Title": "p5.js वेब एडिटर | नया पासवर्ड",
Expand Down
1 change: 1 addition & 0 deletions translations/locales/it/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@
"errorShortPassword": "La password dev'essere di almeno 6 caratteri",
"errorConfirmPassword": "Per favore inserisci la password di conferma",
"errorNewPassword": "Per favore inserisci una nuova password o lascia la password corrente vuota.",
"errorNewPasswordRepeat":"Your New Password must differ from the current one.",
"errorEmptyUsername": "Per favore inserisci un nome utente.",
"errorLongUsername": "Il nome utente deve avere meno di 20 caratteri.",
"errorValidUsername": "Il nome utente dev'essere composto solo da numeri, lettere, must only consist of numbers, letters, punti, trattini e trattini bassi."
Expand Down
1 change: 1 addition & 0 deletions translations/locales/ja/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@
"errorShortPassword": "パスワードは6文字以上にしてください",
"errorConfirmPassword": "確認用のパスワードを入力してください",
"errorNewPassword": "新しいパスワードを入力するか、現在のパスワードを空欄のままにしてください。",
"errorNewPasswordRepeat":"Your New Password must differ from the current one.",
"errorEmptyUsername": "ユーザー名を入力してください。",
"errorLongUsername": "ユーザー名は20文字以内にしてください。",
"errorValidUsername": "ユーザー名は、英数字、ピリオド(.)、ダッシュ(-)、アンダースコア(_)のみで構成されている必要があります。"
Expand Down
1 change: 1 addition & 0 deletions translations/locales/ko/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@
"errorShortPassword": "Password must be at least 6 characters",
"errorConfirmPassword": "Please confirm your password",
"errorNewPassword": "Please enter a new password or leave the current password empty.",
"errorNewPasswordRepeat":"Your New Password must differ from the current one.",
"errorEmptyUsername": "Please enter a username.",
"errorLongUsername": "Username must be less than 20 characters.",
"errorValidUsername": "Username must only consist of numbers, letters, periods, dashes, and underscores."
Expand Down
1 change: 1 addition & 0 deletions translations/locales/pt-BR/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@
"errorShortPassword": "Senha deve ter no mínimo 6 caracteres",
"errorConfirmPassword": "Por favor coloque a senha de confirmação",
"errorNewPassword": "Por favor, adicione uma senha nova ou deixe a atual em branco.",
"errorNewPasswordRepeat":"Your New Password must differ from the current one.",
"errorEmptyUsername": "Por favor coloque um nome de usuário",
"errorLongUsername": "Nome de usuário deve ter menos de 20 caracteres.",
"errorValidUsername": "Nome de usuário pode apenas consistir de números, letras, pontos, Hífens e linha sublinhada."
Expand Down
1 change: 1 addition & 0 deletions translations/locales/sv/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@
"errorShortPassword": "Lösenordet måste vara minst 6 tecken",
"errorConfirmPassword": "Ange en lösenordsbekräftelse",
"errorNewPassword": "Ange ett nytt lösenord eller lämna det nuvarande lösenordet tomt.",
"errorNewPasswordRepeat":"Your New Password must differ from the current one.",
"errorEmptyUsername": "Ange ett användarnamn.",
"errorLongUsername": "Användarnamnet får innehålla högst 19 tecken.",
"errorValidUsername": "Användarnamnet får bara innehålla siffror, bokstäver, punkter, bindestreck och understreck."
Expand Down
1 change: 1 addition & 0 deletions translations/locales/tr/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@
"errorShortPassword": "Şifre en az 6 karakter olmalıdır",
"errorConfirmPassword": "Lütfen şifrenizi doğrulayın",
"errorNewPassword": "Lütfen yeni bir şifre girin veya mevcut şifreyi boş bırakın.",
"errorNewPasswordRepeat":"Your New Password must differ from the current one.",
"errorEmptyUsername": "Lütfen bir kullanıcı adı girin.",
"errorLongUsername": "Kullanıcı adı 20 karakterden az olmalıdır.",
"errorValidUsername": "Kullanıcı adı sadece sayılar, harfler, noktalar, tireler ve alt çizgilerden oluşmalıdır."
Expand Down
1 change: 1 addition & 0 deletions translations/locales/uk-UA/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@
"errorShortPassword": "Пароль повинен містити щонайменше 6 символів",
"errorConfirmPassword": "Введіть підтвердження пароля",
"errorNewPassword": "Введіть новий пароль або залиште поточний пароль порожнім.",
"errorNewPasswordRepeat":"Your New Password must differ from the current one.",
"errorEmptyUsername": "Введіть ім'я користувача.",
"errorLongUsername": "Ім'я користувача має містити менше 20 символів.",
"errorValidUsername": "Ім'я користувача має складатися лише з цифр, літер, крапок, тире та символа підкреслення."
Expand Down
1 change: 1 addition & 0 deletions translations/locales/ur/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@
"errorShortPassword": "پاس ورڈ کم از کم 6 حروف کا ہونا چاہیے۔",
"errorConfirmPassword": "براہ کرم اپنے پاس ورڈ کی تصدیق کریں۔",
"errorNewPassword": "براہ کرم نیا پاس ورڈ درج کریں یا موجودہ پاس ورڈ کو خالی چھوڑ دیں۔",
"errorNewPasswordRepeat":"Your New Password must differ from the current one.",
"errorEmptyUsername": "براہ کرم ایک صارف نام درج کریں۔",
"errorLongUsername": "صارف کا نام 20 حروف سے کم ہونا چاہیے۔",
"errorValidUsername": "صارف کا نام صرف نمبرز، حروف، پیریڈز، ڈیشز اور انڈر سکور پر مشتمل ہونا چاہیے۔"
Expand Down
1 change: 1 addition & 0 deletions translations/locales/zh-CN/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@
"errorShortPassword": "密码至少六位",
"errorConfirmPassword": "请再次输入密码以确认",
"errorNewPassword": "请输入一个新密码或保持当前密码为空",
"errorNewPasswordRepeat":"Your New Password must differ from the current one.",
"errorEmptyUsername": "请输入一个用户名",
"errorLongUsername": "用户名至多20位",
"errorValidUsername": "用户名只能含有数字,字母,和某些标点符号(. - _)。"
Expand Down
1 change: 1 addition & 0 deletions translations/locales/zh-TW/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@
"errorShortPassword": "密碼至少要有 6 個字元",
"errorConfirmPassword": "請再輸入一次密碼確認正確性",
"errorNewPassword": "請輸入新密碼或讓目前密碼欄位留空",
"errorNewPasswordRepeat":"Your New Password must differ from the current one.",
"errorEmptyUsername": "請輸入使用者名稱",
"errorLongUsername": "使用者名稱最多只能 20 個字元",
"errorValidUsername": "使用者名稱只能有數字、字母、英文句點、減號以及底線符號"
Expand Down
Loading