diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c91b12..b1314bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: 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":