mirror of
https://github.com/element-hq/synapse
synced 2024-08-19 23:10:20 +00:00
Forbid non-ASes from registering users whose names begin with '_' (SYN-738)
This commit is contained in:
parent
c38b7c4104
commit
05f6447301
1 changed files with 7 additions and 0 deletions
|
@ -53,6 +53,13 @@ class RegistrationHandler(BaseHandler):
|
||||||
Codes.INVALID_USERNAME
|
Codes.INVALID_USERNAME
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if localpart[0] == '_':
|
||||||
|
raise SynapseError(
|
||||||
|
400,
|
||||||
|
"User ID may not begin with _",
|
||||||
|
Codes.INVALID_USERNAME
|
||||||
|
)
|
||||||
|
|
||||||
user = UserID(localpart, self.hs.hostname)
|
user = UserID(localpart, self.hs.hostname)
|
||||||
user_id = user.to_string()
|
user_id = user.to_string()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue