summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2020-01-13 12:47:30 +0000
committerGitHub <noreply@github.com>2020-01-13 12:47:30 +0000
commit2d07c73777e837213f1c3c85b9cb446aac8b6170 (patch)
treece8bd4f92c7dca425958a2a04aec7518b68034f4
parentMerge pull request #6689 from matrix-org/rav/saml_mapping_provider_updates (diff)
downloadsynapse-2d07c73777e837213f1c3c85b9cb446aac8b6170.tar.xz
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
-rw-r--r--changelog.d/6690.bugfix1
-rw-r--r--synapse/handlers/register.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/changelog.d/6690.bugfix b/changelog.d/6690.bugfix
new file mode 100644
index 0000000000..30ce1dc9f7
--- /dev/null
+++ b/changelog.d/6690.bugfix
@@ -0,0 +1 @@
+Fix a bug where we would assign a numeric userid if somebody tried registering with an empty username.
diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py
index 8a7d965feb..885da82985 100644
--- a/synapse/handlers/register.py
+++ b/synapse/handlers/register.py
@@ -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