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.raise_for_status()
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
else:
return response.json()

View File

@ -37,7 +37,7 @@ class AzureADClient(OAuth2Client):
)
response.raise_for_status()
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
else:
return response.json()

View File

@ -36,7 +36,7 @@ class MailcowOAuth2Client(OAuth2Client):
)
response.raise_for_status()
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
else:
return response.json()