1
Fork 0

Fix: Make 3-letter usernames possible

This commit is contained in:
Bauke 2019-11-14 11:17:25 +01:00
parent dafc5db725
commit 93f0bfc84c
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 1 additions and 1 deletions

View File

@ -274,7 +274,7 @@ export function flashMessage(message: string, error = false): void {
// https://gitlab.com/tildes/tildes/blob/master/tildes/tildes/schemas/user.py // https://gitlab.com/tildes/tildes/blob/master/tildes/tildes/schemas/user.py
export function isValidTildesUsername(username: string): boolean { export function isValidTildesUsername(username: string): boolean {
return ( return (
username.length > 3 && username.length > 2 &&
username.length < 20 && username.length < 20 &&
/^[a-z0-9]([a-z0-9]|[_-](?![_-]))*[a-z0-9]$/i.exec(username) !== null /^[a-z0-9]([a-z0-9]|[_-](?![_-]))*[a-z0-9]$/i.exec(username) !== null
); );