Fix auth_key not actually being saved

This would make the user have to login every time.
This commit is contained in:
Lonami Exo
2018-10-22 20:58:07 +02:00
parent 7dece209a0
commit 4562ba9ccf
2 changed files with 6 additions and 11 deletions

View File

@@ -312,16 +312,11 @@ class TelegramBaseClient(abc.ABC):
self.session.server_address, self.session.port,
loop=self._loop, proxy=self._proxy
))
self.session.auth_key = self._sender.auth_key
await self._sender.send(self._init_with(
functions.help.GetConfigRequest()))
# AuthKey is a property, so re-setting it has side-effects.
# Since it's used as a reference and only its inner payload
# may have actually changed after connecting, we use the
# reference from the session file itself as its value.
self.session.auth_key = self.session.auth_key
self._updates_handle = self._loop.create_task(self._update_loop())
def is_connected(self):