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.

This commit is contained in:
David Lovas 2018-08-16 02:17:17 +01:00
parent f4b9c9d6d4
commit 6618690a7c

View File

@ -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 '