Skip to content

Commit

Permalink
Save session in complete_login
Browse files Browse the repository at this point in the history
  • Loading branch information
Lonami committed Oct 17, 2023
1 parent 4465644 commit 186dd38
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client/src/telethon/_impl/client/client/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,17 @@ async def complete_login(client: Client, auth: abcs.auth.Authorization) -> User:
try:
state = await client(functions.updates.get_state())
client._message_box.set_state(state)
client._session.state = client._message_box.session_state()
except Exception:
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


Expand Down

0 comments on commit 186dd38

Please sign in to comment.