Skip to content

Commit

Permalink
Use proper auth override (#50)
Browse files Browse the repository at this point in the history
* Use proper auth override

* Fix response schema
  • Loading branch information
at-white authored Nov 25, 2024
1 parent ee6cd0e commit d4bd431
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sdks/python/src/redactive/auth_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class ListConnectionsResponse(BaseModel):
user_id: str
connections: list[str]
current_connections: list[str]


class ExchangeTokenResponse(BaseModel):
Expand Down Expand Up @@ -108,8 +108,7 @@ async def list_connections(self, access_token: str) -> ListConnectionsResponse:
:return: An object containing the user ID and current connections.
:rtype: UserConnections
"""
headers = {"Authorization": f"Bearer {access_token}"}
response = await self._client.get("/api/auth/connections", headers=headers)
response = await self._client.get("/api/auth/connections", auth=BearerAuth(access_token))

if response.status_code != http.HTTPStatus.OK:
raise httpx.RequestError(response.text)
Expand Down

0 comments on commit d4bd431

Please sign in to comment.