mirror of
https://github.com/juanfont/headscale.git
synced 2025-07-13 02:51:07 -04:00
Ensure that a username starts with a letter (#2635)
This commit is contained in:
parent
081af2674b
commit
e73b2a9fb9
@ -37,9 +37,9 @@ func ValidateUsername(username string) error {
|
|||||||
return errors.New("username must be at least 2 characters long")
|
return errors.New("username must be at least 2 characters long")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure the username does not start with a number
|
// Ensure the username starts with a letter
|
||||||
if unicode.IsDigit(rune(username[0])) {
|
if !unicode.IsLetter(rune(username[0])) {
|
||||||
return errors.New("username cannot start with a number")
|
return errors.New("username must start with a letter")
|
||||||
}
|
}
|
||||||
|
|
||||||
atCount := 0
|
atCount := 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user