Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ jobs:
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install the project dependencies
run: poetry install -q
- name: Run the automated tests
env:
ADJUST_EMAIL: ${{ secrets.ADJUST_EMAIL }}
ADJUST_PASSWORD: ${{ secrets.ADJUST_PASSWORD }}
run: |
echo email=$ADJUST_EMAIL
echo password=$ADJUST_PASSWORD
poetry run pytest --cov=adjust --cov-report xml:coverage.xml -vv
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
Expand Down
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