1
Fork 0

Fix: Properly validate usernames with greater/less and equal than.

This commit is contained in:
Bauke 2020-03-05 13:21:23 +01:00
parent 097feb33b4
commit bd9e5bba51
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 2 additions and 2 deletions

View File

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