fix(usernames): remove more ratzen fratzen dupe strings

This commit is contained in:
Sabe Jones
2018-10-13 21:05:07 -05:00
parent 60b26d4ec0
commit 392b54aa7b
3 changed files with 3 additions and 6 deletions

View File

@@ -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.<br><br>If you'd like to learn more about this change, <a href='http://habitica.wikia.com/wiki/Player_Names' target='_blank'>visit our wiki</a>.", "usernameInfo": "Login names are now unique usernames that will be visible beside your display name and used for invitations, chat @mentions, and messaging.<br><br>If you'd like to learn more about this change, <a href='http://habitica.wikia.com/wiki/Player_Names' target='_blank'>visit our wiki</a>.",
"usernameTOSRequirements": "Usernames must conform to our <a href='/static/terms' target='_blank'>Terms of Service</a> and <a href='/static/community-guidelines' target='_blank'>Community Guidelines</a>. If you didnt previously set a login name, your username was auto-generated.", "usernameTOSRequirements": "Usernames must conform to our <a href='/static/terms' target='_blank'>Terms of Service</a> and <a href='/static/community-guidelines' target='_blank'>Community Guidelines</a>. If you didnt previously set a login name, your username was auto-generated.",
"usernameTaken": "Username already taken.", "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.", "passwordConfirmationMatch": "Password confirmation doesn't match password.",
"invalidLoginCredentials": "Incorrect username and/or email and/or password.", "invalidLoginCredentials": "Incorrect username and/or email and/or password.",
"passwordResetPage": "Reset Password", "passwordResetPage": "Reset Password",

View File

@@ -79,8 +79,8 @@ async function registerLocal (req, res, { isV3 = false }) {
notEmpty: true, notEmpty: true,
errorMessage: res.t('missingUsername'), errorMessage: res.t('missingUsername'),
// TODO use the constants in the error message above // TODO use the constants in the error message above
isLength: {options: {min: USERNAME_LENGTH_MIN, max: USERNAME_LENGTH_MAX}, errorMessage: res.t('usernameWrongLength')}, isLength: {options: {min: USERNAME_LENGTH_MIN, max: USERNAME_LENGTH_MAX}, errorMessage: res.t('usernameIssueLength')},
matches: {options: /^[-_a-zA-Z0-9]+$/, errorMessage: res.t('usernameBadCharacters')}, matches: {options: /^[-_a-zA-Z0-9]+$/, errorMessage: res.t('usernameIssueInvalidCharacters')},
}, },
email: { email: {
notEmpty: true, notEmpty: true,

View File

@@ -28,7 +28,7 @@ function usernameContainsInvalidCharacters (username) {
export function verifyDisplayName (displayName, res) { export function verifyDisplayName (displayName, res) {
let issues = []; 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')); if (nameContainsSlur(displayName)) issues.push(res.t('displaynameIssueSlur'));
return issues; return issues;