Skip to content

Commit

Permalink
Add troubleshooting info to warning log
Browse files Browse the repository at this point in the history
  • Loading branch information
wvanhed committed Jan 10, 2024
1 parent 1949d67 commit 0d145ca
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/mijnbib/login_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,19 @@ def _log_in(self):
_log.debug(f"login (4) cookies : {response.cookies}")
# _log.debug(f"login (4) text : {response.text}")

# Note: the above request gives a 302 redirection, but we don't follow it (too costly)

# Soft verification if we are logged in
if ("mijn-bibliotheek/overzicht" not in response.headers.get("location", "")) and (
"mijn-bibliotheek/lidmaatschappen" not in response.headers.get("location", "")
):
_log.warning(
"Not clear if properly logged in. Was expecting "
f"Not clear if properly logged in (as '{self._username}'). Was expecting "
"'mijn-bibliotheek/overzicht' or 'mijn-bibliotheek/lidmaatschappen' "
"in location header, but couldn't find it"
)
_log.warning(
"Related troubleshooting info. "
f"Status code: '{response.status_code}'. "
f"Headers: '{response.headers}'"
)

0 comments on commit 0d145ca

Please sign in to comment.