diff --git a/eskiz_sms/token.py b/eskiz_sms/token.py index 0eb2438..460af06 100644 --- a/eskiz_sms/token.py +++ b/eskiz_sms/token.py @@ -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() @@ -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( @@ -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() @@ -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']