Skip to content

Commit

Permalink
login method updated
Browse files Browse the repository at this point in the history
  • Loading branch information
gpereyraJC authored Sep 12, 2024
1 parent f823955 commit 183bd7b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions adjust/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ def _api(self, type: Type[T], path: str, method: str = "GET", **data: Any) -> T:
self._log_in_if_needed()
url = "https://api.adjust.com/" + path
headers = dict(Accept="application/json")

# If logging in, add the authorization token to the headers
if path == "accounts/users/sign_in":
token = data['user']['password']
headers["Authorization"] = f"Token token={token}"
data = None

if not data:
r = self._session.get(url, headers=headers)
elif method == "PUT":
Expand Down

0 comments on commit 183bd7b

Please sign in to comment.