mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
feat(usernames): modal to force verification
This commit is contained in:
@@ -26,6 +26,14 @@ function usernameContainsInvalidCharacters (username) {
|
||||
return match !== null && match[0] !== null;
|
||||
}
|
||||
|
||||
export function verifyDisplayName (displayName, res) {
|
||||
let issues = [];
|
||||
if (displayName.length < 1 || displayName.length > 30) issues.push(res.t('displayNameWrongLength'));
|
||||
if (nameContainsSlur(displayName)) issues.push(res.t('displaynameIssueSlur'));
|
||||
|
||||
return issues;
|
||||
}
|
||||
|
||||
export function verifyUsername (username, res) {
|
||||
let issues = [];
|
||||
if (username.length < 1 || username.length > 20) issues.push(res.t('usernameIssueLength'));
|
||||
|
||||
Reference in New Issue
Block a user