mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-21 03:42:55 +03:00
fix strip_invalid_mxid_characters
This commit is contained in:
parent
41b987cbc5
commit
907a62df28
1 changed files with 2 additions and 2 deletions
|
@ -387,7 +387,7 @@ class RegisterRestServlet(RestServlet):
|
||||||
self.hs.config.register_mxid_from_3pid == 'email' and
|
self.hs.config.register_mxid_from_3pid == 'email' and
|
||||||
LoginType.EMAIL_IDENTITY in auth_result
|
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(
|
desired_username = types.strip_invalid_mxid_characters(
|
||||||
address.replace('@', '-').lower()
|
address.replace('@', '-').lower()
|
||||||
)
|
)
|
||||||
|
@ -427,7 +427,7 @@ class RegisterRestServlet(RestServlet):
|
||||||
self.hs.config.register_mxid_from_3pid == 'msisdn' and
|
self.hs.config.register_mxid_from_3pid == 'msisdn' and
|
||||||
LoginType.MSISDN in auth_result
|
LoginType.MSISDN in auth_result
|
||||||
):
|
):
|
||||||
desired_username = auth_result[login_type]['address']
|
desired_username = auth_result[LoginType.MSISDN]['address']
|
||||||
else:
|
else:
|
||||||
raise SynapseError(
|
raise SynapseError(
|
||||||
400, "Cannot derive mxid from 3pid; no recognised 3pid"
|
400, "Cannot derive mxid from 3pid; no recognised 3pid"
|
||||||
|
|
Loading…
Reference in a new issue