sources/oauth: log body when get_profile fails

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-03-02 20:37:42 +01:00
parent 025fc3fe96
commit c57fbcfd89
3 changed files with 3 additions and 3 deletions

View file

@ -44,7 +44,7 @@ class BaseOAuthClient:
response = self.do_request("get", profile_url, token=token) response = self.do_request("get", profile_url, token=token)
response.raise_for_status() response.raise_for_status()
except RequestException as exc: except RequestException as exc:
LOGGER.warning("Unable to fetch user profile", exc=exc) LOGGER.warning("Unable to fetch user profile", exc=exc, body=response.text)
return None return None
else: else:
return response.json() return response.json()

View file

@ -37,7 +37,7 @@ class AzureADClient(OAuth2Client):
) )
response.raise_for_status() response.raise_for_status()
except RequestException as exc: except RequestException as exc:
LOGGER.warning("Unable to fetch user profile", exc=exc) LOGGER.warning("Unable to fetch user profile", exc=exc, body=response.text)
return None return None
else: else:
return response.json() return response.json()

View file

@ -36,7 +36,7 @@ class MailcowOAuth2Client(OAuth2Client):
) )
response.raise_for_status() response.raise_for_status()
except RequestException as exc: except RequestException as exc:
LOGGER.warning("Unable to fetch user profile", exc=exc) LOGGER.warning("Unable to fetch user profile", exc=exc, body=response.text)
return None return None
else: else:
return response.json() return response.json()