Skip to content

Commit

Permalink
Work around client replacing reg params
Browse files Browse the repository at this point in the history
Works around element-hq/riot-android#715
and equivalent for iOS
  • Loading branch information
dbkr committed Nov 18, 2016
1 parent 9d58ccc commit 544722b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions synapse/rest/client/v2_alpha/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,18 @@ def on_POST(self, request):

guest_access_token = body.get("guest_access_token", None)

if (
'initial_device_display_name' in body and
'password' not in body
):
# ignore 'initial_device_display_name' if sent without
# a password to work around a client bug where it sent
# the 'initial_device_display_name' param alone, wiping out
# the original registration params
logger.warn("Ignoring initial_device_display_name without password")
del body['initial_device_display_name']


session_id = self.auth_handler.get_session_id(body)
registered_user_id = None
if session_id:
Expand Down

0 comments on commit 544722b

Please sign in to comment.