Skip to content

Commit 8eeb9cf

Browse files
committed
Fixed a bug where requests would not be properly authenticated
1 parent 5203777 commit 8eeb9cf

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

simplipy/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ async def _authenticate(self, payload_data: dict) -> None:
6767
data=payload_data,
6868
auth=BasicAuth(
6969
login=DEFAULT_AUTH_USERNAME, password='', encoding='latin1'))
70+
self._access_token = token_resp['access_token']
71+
self._access_token_expire = datetime.now() + timedelta(
72+
seconds=int(token_resp['expires_in']))
7073
self.refresh_token = token_resp['refresh_token']
7174

7275
auth_check_resp = await self.request('get', 'api/authCheck')
7376
self.user_id = auth_check_resp['userId']
74-
self._access_token = token_resp['access_token']
75-
self._access_token_expire = datetime.now() + timedelta(
76-
seconds=int(token_resp['expires_in']))
7777

7878
async def _refresh_access_token(self, refresh_token: str) -> None:
7979
"""Regenerate an access token."""

0 commit comments

Comments
 (0)