From 183bd7b3d9ddfd94204dd5904d9ae6c1f2526315 Mon Sep 17 00:00:00 2001 From: Guido Pereyra Date: Thu, 12 Sep 2024 15:11:44 -0300 Subject: [PATCH] login method updated --- adjust/api/api.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/adjust/api/api.py b/adjust/api/api.py index 38f906a..88e08cf 100755 --- a/adjust/api/api.py +++ b/adjust/api/api.py @@ -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":