From 6618690a7c97f06c3405e4ac7e73a33939a5d9b6 Mon Sep 17 00:00:00 2001 From: David Lovas Date: Thu, 16 Aug 2018 02:17:17 +0100 Subject: [PATCH] Check to make sure user does not pass nothing when prompted for code, as this would result in 'Signed in successfully as ' to be printed if the phone number input was a valid & registered account. --- telethon/client/auth.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/telethon/client/auth.py b/telethon/client/auth.py index 8ed62b5a..4db42a70 100644 --- a/telethon/client/auth.py +++ b/telethon/client/auth.py @@ -82,7 +82,10 @@ class AuthMethods(MessageParseMethods, UserMethods): """ if code_callback is None: def code_callback(): - return input('Please enter the code you received: ') + code = input('Please enter the code you received: ') + if code == '': + code = 1 + return code elif not callable(code_callback): raise ValueError( 'The code_callback parameter needs to be a callable '