diff --git a/website/common/locales/en/front.json b/website/common/locales/en/front.json index 9b5fbd29c6..6c70e575f3 100644 --- a/website/common/locales/en/front.json +++ b/website/common/locales/en/front.json @@ -274,9 +274,6 @@ "usernameInfo": "Login names are now unique usernames that will be visible beside your display name and used for invitations, chat @mentions, and messaging.

If you'd like to learn more about this change, visit our wiki.", "usernameTOSRequirements": "Usernames must conform to our Terms of Service and Community Guidelines. If you didn’t previously set a login name, your username was auto-generated.", "usernameTaken": "Username already taken.", - "usernameWrongLength": "Username must be between 1 and 20 characters long.", - "displayNameWrongLength": "Display names must be between 1 and 30 characters long.", - "usernameBadCharacters": "Usernames can only contain letters a to z, numbers 0 to 9, hyphens, or underscores.", "passwordConfirmationMatch": "Password confirmation doesn't match password.", "invalidLoginCredentials": "Incorrect username and/or email and/or password.", "passwordResetPage": "Reset Password", diff --git a/website/server/libs/auth/index.js b/website/server/libs/auth/index.js index f783c59b40..d78c381b2c 100644 --- a/website/server/libs/auth/index.js +++ b/website/server/libs/auth/index.js @@ -79,8 +79,8 @@ async function registerLocal (req, res, { isV3 = false }) { notEmpty: true, errorMessage: res.t('missingUsername'), // TODO use the constants in the error message above - isLength: {options: {min: USERNAME_LENGTH_MIN, max: USERNAME_LENGTH_MAX}, errorMessage: res.t('usernameWrongLength')}, - matches: {options: /^[-_a-zA-Z0-9]+$/, errorMessage: res.t('usernameBadCharacters')}, + isLength: {options: {min: USERNAME_LENGTH_MIN, max: USERNAME_LENGTH_MAX}, errorMessage: res.t('usernameIssueLength')}, + matches: {options: /^[-_a-zA-Z0-9]+$/, errorMessage: res.t('usernameIssueInvalidCharacters')}, }, email: { notEmpty: true, diff --git a/website/server/libs/user/validation.js b/website/server/libs/user/validation.js index a064ef1a0a..097ef70cdf 100644 --- a/website/server/libs/user/validation.js +++ b/website/server/libs/user/validation.js @@ -28,7 +28,7 @@ function usernameContainsInvalidCharacters (username) { export function verifyDisplayName (displayName, res) { let issues = []; - if (displayName.length < 1 || displayName.length > 30) issues.push(res.t('displayNameWrongLength')); + if (displayName.length < 1 || displayName.length > 30) issues.push(res.t('displaynameIssueLength')); if (nameContainsSlur(displayName)) issues.push(res.t('displaynameIssueSlur')); return issues;