mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Fix Session not being able to save auth_key=None
This commit is contained in:
parent
d788d30de2
commit
6a043b7371
|
@ -123,7 +123,8 @@ class JsonSession:
|
|||
'time_offset': self.time_offset,
|
||||
'server_address': self.server_address,
|
||||
'auth_key_data':
|
||||
b64encode(self.auth_key.key).decode('ascii')
|
||||
b64encode(self.auth_key.key).decode('ascii')\
|
||||
if self.auth_key else None
|
||||
}, file)
|
||||
|
||||
def delete(self):
|
||||
|
@ -160,6 +161,7 @@ class JsonSession:
|
|||
# FIXME We need to import the AuthKey here or otherwise
|
||||
# we get cyclic dependencies.
|
||||
from ..crypto import AuthKey
|
||||
if data['auth_key_data'] is not None:
|
||||
key = b64decode(data['auth_key_data'])
|
||||
result.auth_key = AuthKey(data=key)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user