summary refs log tree commit diff
path: root/synapse/rest/client
diff options
context:
space:
mode:
authorMatrix <matrix@i.tchap.gouv.fr>2018-05-03 23:54:20 +0000
committerMatrix <matrix@i.tchap.gouv.fr>2018-05-03 23:54:36 +0000
commit907a62df286eb013eb6475b1c47f285a7e5750e1 (patch)
tree6889f95d65ffc8f70bd256ae6c10458603c1f742 /synapse/rest/client
parentunbreak 3pid deletion (diff)
downloadsynapse-907a62df286eb013eb6475b1c47f285a7e5750e1.tar.xz
fix strip_invalid_mxid_characters
Diffstat (limited to 'synapse/rest/client')
-rw-r--r--synapse/rest/client/v2_alpha/register.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/rest/client/v2_alpha/register.py b/synapse/rest/client/v2_alpha/register.py
index b5704a39d9..36676c9fa8 100644
--- a/synapse/rest/client/v2_alpha/register.py
+++ b/synapse/rest/client/v2_alpha/register.py
@@ -387,7 +387,7 @@ class RegisterRestServlet(RestServlet):
                     self.hs.config.register_mxid_from_3pid == 'email' and
                     LoginType.EMAIL_IDENTITY in auth_result
                 ):
-                    address = auth_result[login_type]['address']
+                    address = auth_result[LoginType.EMAIL_IDENTITY]['address']
                     desired_username = types.strip_invalid_mxid_characters(
                         address.replace('@', '-').lower()
                     )
@@ -427,7 +427,7 @@ class RegisterRestServlet(RestServlet):
                     self.hs.config.register_mxid_from_3pid == 'msisdn' and
                     LoginType.MSISDN in auth_result
                 ):
-                    desired_username = auth_result[login_type]['address']
+                    desired_username = auth_result[LoginType.MSISDN]['address']
                 else:
                     raise SynapseError(
                         400, "Cannot derive mxid from 3pid; no recognised 3pid"