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 of None as the current_password parameter.
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