Skip to content

Commit

Permalink
update request_cookies function
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando Aureliano da Silva Maia committed Oct 23, 2023
1 parent 6027c4f commit cd5974a
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions tokendito/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -1217,18 +1217,7 @@ def request_cookies(url, session_token):
logger.debug(f"Requesting session cookies from {url}")

# Use the HTTP client to make a POST request.
response = HTTP_client.post(url, json=data, headers=headers)

# Handle response errors if necessary
if response.status_code != 200:
logger.error(
f"Error making request to {url}. "
f"Status code: {response.status_code}. "
f"Response: {response.text}"
)
sys.exit(1)

response_json = response.json()
response_json = HTTP_client.post(url, json=data, headers=headers, return_json=True)

if "id" not in response_json:
logger.error(f"'id' not found in response. Full response: {response_json}")
Expand Down

0 comments on commit cd5974a

Please sign in to comment.