Skip to content

Commit

Permalink
Add more logging to debug failing logins
Browse files Browse the repository at this point in the history
  • Loading branch information
bradtgmurray committed Feb 5, 2024
1 parent da06ec3 commit 416e459
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions linkedin_matrix/web/provisioning_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ def parse_cookies(c):
for cookie in c.split("; "):
key, val = cookie.split("=", 1)
cookie_dict[key] = val
logging.info(f"Got cookies: {cookie_dict.keys()}")

if "all_headers" in req_data:
all_headers = req_data["all_headers"]
logging.info(f"Got headers: {all_headers.keys()}")

cookies = all_headers.pop("Cookie", all_headers.pop("cookie", None))
if not cookies:
Expand All @@ -127,6 +129,7 @@ def parse_cookies(c):
elif "li_at" in req_data and "JSESSIONID" in req_data:
# The request is just a dictionary of individual cookies
cookie_dict = req_data
logging.info(f"Legacy login, got cookies: {cookie_dict.keys()}")

if "li_at" not in cookie_dict or "JSESSIONID" not in cookie_dict:
return web.HTTPBadRequest(body='{"error": "Missing keys"}', headers=self._headers)
Expand Down

0 comments on commit 416e459

Please sign in to comment.