diff --git a/Two-Factor-Authorization.md b/Two-Factor-Authorization.md index 88175ad..0628a0b 100644 --- a/Two-Factor-Authorization.md +++ b/Two-Factor-Authorization.md @@ -1,13 +1,14 @@ If you have Two Factor Authorization (from now on, 2FA) enabled on your account, calling `.sign_in` will raise a `SessionPasswordNeededError`. When this happens, just `.sign_in()` again with a `password=`: ```python +import getpass from telethon.errors import SessionPasswordNeededError client.sign_in(phone) try: client.sign_in(code=input('Enter code: ')) except SessionPasswordNeededError: - client.sign_in(password=input('Enter password: ')) + client.sign_in(password=getpass.getpass()) ``` ## Enabling 2FA