Telethon
Telethon copied to clipboard
`TelegramClient.edit_2fa` returns invalid value when disabling 2FA with invalid password
Code that causes the issue
async with TelegramClient(...) as client:
result = await client.edit_2fa("invalid password", None)
print(result) # True
Expected behavior
I encountered an issue when attempting to disable 2FA on an account that does not have 2FA enabled. The method TelegramClient.edit_2fa returns an invalid value when I pass an invalid password instead of None as the current_password parameter.
Steps to Reproduce:
- Use an account that does not have 2FA enabled.
- Attempt to disable 2FA using
TelegramClient.edit_2fa, providing an invalid password instead ofNoneas thecurrent_passwordparameter.
Actual behavior
It should return False
Traceback
No response
Telethon version
1.38.1
Python version
3.11.9
Operating system (including distribution name and version)
Ubuntu 24.04
Other details
No response
Checklist
- [X] The error is in the library's code, and not in my own.
- [X] I have searched for this issue before posting it and there isn't an open duplicate.
- [X] I ran
pip install -U https://github.com/LonamiWebs/Telethon/archive/v1.zipand triggered the bug in the latest version.