mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
fix(usernames): remove more ratzen fratzen dupe strings
This commit is contained in:
@@ -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>.",
|
||||
"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 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",
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user