From 22a371444dcfe4411b75b47efa12e06b16e2ca25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=A4fer?= Date: Sun, 8 Mar 2020 13:54:52 +0100 Subject: [PATCH] Remove compatibility hacks after bugs got fixed See-Also: https://issues.prosody.im/1500 See-Also: https://issues.prosody.im/1501 --- snikket_web/prosodyclient.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/snikket_web/prosodyclient.py b/snikket_web/prosodyclient.py index 08f90d2..e6a09f6 100644 --- a/snikket_web/prosodyclient.py +++ b/snikket_web/prosodyclient.py @@ -148,15 +148,9 @@ class ProsodyClient: self.logger.debug("sending OAuth2 request (payload omitted)") async with session.post(self._login_endpoint, data=request) as resp: auth_status = resp.status - auth_data = (await resp.read()) - # XXX: this is a hack to work around mod_http_oauth2 not always - # setting the correct Content-Type on the reply. #1500 / #1501 - auth_info = json.loads(auth_data.decode("utf-8")) - if "error" in auth_info and "context" in auth_info["error"]: - auth_info = auth_info["error"]["context"]["oauth2_response"] + auth_info = (await resp.json()) - # XXX: prosody-modules#1502 - if auth_status in [400, 401] or "error" in auth_info: + if auth_status in [400, 401]: self.logger.debug("oauth2 error: %r", auth_info) # OAuth2 spec says that’s what can happen when some stuff is # wrong.