2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 21:38:04 +00:00
This commit is contained in:
Elliot Manson 2019-07-14 22:23:23 +04:00
parent 50d62259a8
commit 52902d4d43

View File

@ -577,20 +577,8 @@ class Client(Methods, BaseClient):
password_invalid_raises = self.password is not None
def default_recovery_callback(email_pattern: str) -> str:
print("An e-mail containing the recovery code has been sent to {}".format(email_pattern))
return input("Enter password recovery code: ")
while True:
try:
r = self.send(functions.auth.RequestPasswordRecovery())
self.recovery_code = (
default_recovery_callback(r.email_pattern) if self.recovery_code is None
else str(self.recovery_code(r.email_pattern)) if callable(self.recovery_code)
else str(self.recovery_code)
)
r = self.send(
functions.auth.RecoverPassword(
code=self.recovery_code