Fix JWT login (#5555)

* Fix JWT login with register

Signed-off-by: Pau Rodriguez-Estivill <prodrigestivill@gmail.com>

* Add pyjwt conditional dependency

Signed-off-by: Pau Rodriguez-Estivill <prodrigestivill@gmail.com>

* Added changelog file

Signed-off-by: Pau Rodriguez-Estivill <prodrigestivill@gmail.com>

* Improved changelog description

Signed-off-by: Pau Rodriguez-Estivill <prodrigestivill@gmail.com>
This commit is contained in:
PauRE 2019-06-27 13:02:41 +02:00 committed by Richard van der Hoff
parent b4db70e167
commit 856ea04eb3
3 changed files with 3 additions and 1 deletions

1
changelog.d/5555.bugfix Normal file
View File

@ -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.

View File

@ -95,6 +95,7 @@ CONDITIONAL_REQUIREMENTS = {
"url_preview": ["lxml>=3.5.0"], "url_preview": ["lxml>=3.5.0"],
"test": ["mock>=2.0", "parameterized"], "test": ["mock>=2.0", "parameterized"],
"sentry": ["sentry-sdk>=0.7.2"], "sentry": ["sentry-sdk>=0.7.2"],
"jwt": ["pyjwt>=1.6.4"],
} }
ALL_OPTIONAL_REQUIREMENTS = set() ALL_OPTIONAL_REQUIREMENTS = set()

View File

@ -336,7 +336,7 @@ class LoginRestServlet(RestServlet):
} }
else: else:
user_id, access_token = ( 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") device_id = login_submission.get("device_id")