Skip to content

Commit

Permalink
get token bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mlkvdev committed Mar 22, 2023
1 parent e860ff1 commit 9b7b30f
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions eskiz_sms/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def _get(self, get_new: bool = False):
self._value = self._get_new_token()
if self.save_token:
self._save_to_env()

if not self.__token_checked:
self._check()

Expand All @@ -91,11 +90,8 @@ def _get_new_token(self) -> str:
self._credentials
)
)
self._value = response.data['data']['token']
self.__token_checked = True
if self.save_token:
self._save_to_env()
return self._value
return response.data['data']['token']

def _check(self):
self._request(
Expand Down Expand Up @@ -124,7 +120,6 @@ async def _aget(self, get_new: bool = False):
self._value = await self._aget_new_token()
if self.save_token:
self._save_to_env()

if not self.__token_checked:
await self._acheck()

Expand All @@ -150,8 +145,5 @@ async def _aget_new_token(self):
self._credentials
)
)
self._value = response.data['data']['token']
self.__token_checked = True
if self.save_token:
self._save_to_env()
return self._value
return response.data['data']['token']

0 comments on commit 9b7b30f

Please sign in to comment.