Skip to content

Commit

Permalink
Removed auth via body/param
Browse files Browse the repository at this point in the history
- Removed auth via body/param since it is not needed in 0.19.0
  • Loading branch information
isFakeAccount committed Dec 21, 2023
1 parent 57be09c commit 2b96891
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions async_lemmy_py/request_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ async def get(self, endpoint: str, params: Optional[dict[Any, Any]] = None) -> d

url: str = f"{self.base_url}/api/v3/{endpoint}"
headers = {"Authorization": f"Bearer {self.jwt_token}"}
params_with_auth = {"auth": self.jwt_token} if params is None else {**params, "auth": self.jwt_token}

async with self.client_session.get(url, headers=headers, params=params_with_auth) as resp:
async with self.client_session.get(url, headers=headers, params=params) as resp:
return await self._handle_response(resp)

async def post(
Expand All @@ -75,9 +74,8 @@ async def post(
"""
url: str = f"{self.base_url}/api/v3/{endpoint}"
headers = {"Authorization": f"Bearer {self.jwt_token}"}
json_with_auth = {"auth": self.jwt_token} if json is None else {**json, "auth": self.jwt_token}

async with self.client_session.post(url, headers=headers, params=params, data=data, json=json_with_auth) as resp:
async with self.client_session.post(url, headers=headers, params=params, data=data, json=json) as resp:
return await self._handle_response(resp)

async def _handle_response(self, resp: ClientResponse) -> dict[Any, Any]:
Expand Down

0 comments on commit 2b96891

Please sign in to comment.