1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-10-25 04:37:41 +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

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".