You've already forked snikket-web-portal
Remove compatibility hacks after bugs got fixed
See-Also: https://issues.prosody.im/1500 See-Also: https://issues.prosody.im/1501
This commit is contained in:
@@ -148,15 +148,9 @@ class ProsodyClient:
|
|||||||
self.logger.debug("sending OAuth2 request (payload omitted)")
|
self.logger.debug("sending OAuth2 request (payload omitted)")
|
||||||
async with session.post(self._login_endpoint, data=request) as resp:
|
async with session.post(self._login_endpoint, data=request) as resp:
|
||||||
auth_status = resp.status
|
auth_status = resp.status
|
||||||
auth_data = (await resp.read())
|
auth_info = (await resp.json())
|
||||||
# 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"]
|
|
||||||
|
|
||||||
# XXX: prosody-modules#1502
|
if auth_status in [400, 401]:
|
||||||
if auth_status in [400, 401] or "error" in auth_info:
|
|
||||||
self.logger.debug("oauth2 error: %r", auth_info)
|
self.logger.debug("oauth2 error: %r", auth_info)
|
||||||
# OAuth2 spec says that’s what can happen when some stuff is
|
# OAuth2 spec says that’s what can happen when some stuff is
|
||||||
# wrong.
|
# wrong.
|
||||||
|
|||||||
Reference in New Issue
Block a user