From 2b9689121d59b3bbee1500f235c47cecfe3e466a Mon Sep 17 00:00:00 2001 From: Yoshikage Kira Date: Thu, 21 Dec 2023 02:17:54 -0500 Subject: [PATCH] Removed auth via body/param - Removed auth via body/param since it is not needed in 0.19.0 --- async_lemmy_py/request_builder.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/async_lemmy_py/request_builder.py b/async_lemmy_py/request_builder.py index af9ea53..d4b4d50 100644 --- a/async_lemmy_py/request_builder.py +++ b/async_lemmy_py/request_builder.py @@ -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( @@ -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]: