mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-03 21:24:35 +03:00
Fix resending code with empty phone hash (fix #1283)
This commit is contained in:
parent
6da8d1a0ec
commit
7de01a5f94
|
@ -481,7 +481,13 @@ class AuthMethods:
|
|||
except errors.AuthRestartError:
|
||||
return await self.send_code_request(phone, force_sms=force_sms)
|
||||
|
||||
self._phone_code_hash[phone] = phone_hash = result.phone_code_hash
|
||||
# If we already sent a SMS, do not resend the code (hash may be empty)
|
||||
if isinstance(result.type, types.auth.SentCodeTypeSms):
|
||||
force_sms = False
|
||||
|
||||
# phone_code_hash may be empty, if it is, do not save it (#1283)
|
||||
if result.phone_code_hash:
|
||||
self._phone_code_hash[phone] = phone_hash = result.phone_code_hash
|
||||
else:
|
||||
force_sms = True
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user