Don't assign numeric IDs for empty usernames (#6690)

Fix a bug where we would assign a numeric userid if somebody tried registering
with an empty username
This commit is contained in:
Richard van der Hoff 2020-01-13 12:47:30 +00:00 committed by GitHub
parent 3cfac9593c
commit 2d07c73777
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

1
changelog.d/6690.bugfix Normal file
View File

@ -0,0 +1 @@
Fix a bug where we would assign a numeric userid if somebody tried registering with an empty username.

View File

@ -174,7 +174,7 @@ class RegistrationHandler(BaseHandler):
if password:
password_hash = yield self._auth_handler.hash(password)
if localpart:
if localpart is not None:
yield self.check_username(localpart, guest_access_token=guest_access_token)
was_guest = guest_access_token is not None