mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-24 07:20:42 +03:00
Save session in complete_login
This commit is contained in:
parent
4465644aa1
commit
186dd38ff4
|
@ -42,9 +42,17 @@ async def complete_login(client: Client, auth: abcs.auth.Authorization) -> User:
|
||||||
try:
|
try:
|
||||||
state = await client(functions.updates.get_state())
|
state = await client(functions.updates.get_state())
|
||||||
client._message_box.set_state(state)
|
client._message_box.set_state(state)
|
||||||
|
client._session.state = client._message_box.session_state()
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
await client._storage.save(client._session)
|
||||||
|
except Exception:
|
||||||
|
client._logger.exception(
|
||||||
|
"failed to save session upon login; you may need to login again in future runs"
|
||||||
|
)
|
||||||
|
|
||||||
return user
|
return user
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user