Skip to content

Commit

Permalink
Make the access toke expire 60 seconds earlier (#24)
Browse files Browse the repository at this point in the history
* Make the access toke expire 60 seconds earlier

* Linting
  • Loading branch information
bachya authored Nov 27, 2018
1 parent ef3a48e commit 970e494
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion simplipy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async def _authenticate(self, payload_data: dict) -> None:
encoding='latin1'))
self._access_token = token_resp['access_token']
self._access_token_expire = datetime.now() + timedelta(
seconds=int(token_resp['expires_in']))
seconds=int(token_resp['expires_in']) - 60)
self.refresh_token = token_resp['refresh_token']

auth_check_resp = await self.request('get', 'api/authCheck')
Expand Down
6 changes: 0 additions & 6 deletions simplipy/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@
class SimplipyError(Exception):
"""Define a base error."""

pass


class InvalidCredentialsError(SimplipyError):
"""Define an error related to invalid requests."""

pass


class RequestError(SimplipyError):
"""Define an error related to invalid requests."""

pass

0 comments on commit 970e494

Please sign in to comment.