Skip to content

Commit

Permalink
change: nest cards and cookies under user response upon login (#40)
Browse files Browse the repository at this point in the history
Signed-off-by: Emmanuel <[email protected]>
  • Loading branch information
emmanuelstroem authored Feb 18, 2024
1 parent 48cce81 commit 57c8871
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions functions/authenticate.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,38 @@ def login(username, password):
except Exception as e:
logging.error(f"Error parsing cookie datetime from header: {e}")

user_details = {
"user": details,
"cards": cards,
"credentials": {
"username": username,
"password": password,
"cookies": {
"data": shared.session.cookies.get_dict(),
"issue": str(login_time),
"expiry": str(login_expiry)
}
details["cards"] = cards
details["credentials"] = {
"username": username,
"password": password,
"cookies": {
"data": shared.session.cookies.get_dict(),
"issue": str(login_time),
"expiry": str(login_expiry)
}
}

# user_details = {
# "user": details,
# "cards": cards,
# "credentials": {
# "username": username,
# "password": password,
# "cookies": {
# "data": shared.session.cookies.get_dict(),
# "issue": str(login_time),
# "expiry": str(login_expiry)
# }
# }
# }

# print(json.dumps(shared.session.cookies.get_dict(), indent=2, ensure_ascii=False))

# Clear Session Cookies for next request
shared.session.cookies.clear()
shared.session.close()

return json.dumps(user_details, indent=2, ensure_ascii=False)
return json.dumps(details, indent=2, ensure_ascii=False)
# end successful login

# error_on_login_page = re.search(r'Sorry. A technical error has occurred', login_page.text)
Expand Down

0 comments on commit 57c8871

Please sign in to comment.