From 856ea04eb32f1f40c37d0534955d900fea2c7069 Mon Sep 17 00:00:00 2001 From: PauRE Date: Thu, 27 Jun 2019 13:02:41 +0200 Subject: [PATCH] Fix JWT login (#5555) * Fix JWT login with register Signed-off-by: Pau Rodriguez-Estivill * Add pyjwt conditional dependency Signed-off-by: Pau Rodriguez-Estivill * Added changelog file Signed-off-by: Pau Rodriguez-Estivill * Improved changelog description Signed-off-by: Pau Rodriguez-Estivill --- changelog.d/5555.bugfix | 1 + synapse/python_dependencies.py | 1 + synapse/rest/client/v1/login.py | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelog.d/5555.bugfix diff --git a/changelog.d/5555.bugfix b/changelog.d/5555.bugfix new file mode 100644 index 000000000000..c0b1ecf81aa0 --- /dev/null +++ b/changelog.d/5555.bugfix @@ -0,0 +1 @@ +Fixed m.login.jwt using unregistred user_id and added pyjwt>=1.6.4 as jwt conditional dependencies. Contributed by Pau Rodriguez-Estivill. diff --git a/synapse/python_dependencies.py b/synapse/python_dependencies.py index 13698d963837..6324c00ef184 100644 --- a/synapse/python_dependencies.py +++ b/synapse/python_dependencies.py @@ -95,6 +95,7 @@ "url_preview": ["lxml>=3.5.0"], "test": ["mock>=2.0", "parameterized"], "sentry": ["sentry-sdk>=0.7.2"], + "jwt": ["pyjwt>=1.6.4"], } ALL_OPTIONAL_REQUIREMENTS = set() diff --git a/synapse/rest/client/v1/login.py b/synapse/rest/client/v1/login.py index 4efb679a042a..ede6bc8b1eae 100644 --- a/synapse/rest/client/v1/login.py +++ b/synapse/rest/client/v1/login.py @@ -336,7 +336,7 @@ def do_jwt_login(self, login_submission): } else: user_id, access_token = ( - yield self.handlers.registration_handler.register(localpart=user) + yield self.registration_handler.register(localpart=user) ) device_id = login_submission.get("device_id")