1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-12 21:40:26 +00:00

Disallow registration with anon username

This commit is contained in:
handlerug 2021-05-27 11:41:36 +07:00
parent 94225997d8
commit 6ce1dc0469
No known key found for this signature in database
GPG Key ID: 38009F0605051491

View File

@ -98,7 +98,7 @@ func IsCanonicalName(name string) bool {
}
func IsPossibleUsername(username string) bool {
return UsernamePattern.MatchString(strings.TrimSpace(username))
return username != "anon" && UsernamePattern.MatchString(strings.TrimSpace(username))
}
// HyphaNameFromRq extracts hypha name from http request. You have to also pass the action which is embedded in the url or several actions. For url /hypha/hypha, the action would be "hypha".