mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-09-21 03:08:49 +03:00
Handle empty code when starting
This commit is contained in:
parent
0755421fc2
commit
740a715acd
|
@ -153,6 +153,12 @@ class AuthMethods(MessageParseMethods, UserMethods):
|
||||||
if inspect.isawaitable(value):
|
if inspect.isawaitable(value):
|
||||||
value = await value
|
value = await value
|
||||||
|
|
||||||
|
# Since sign-in with no code works (it sends the code)
|
||||||
|
# we must double-check that here. Else we'll assume we
|
||||||
|
# logged in, and it will return None as the User.
|
||||||
|
if not value:
|
||||||
|
raise errors.PhoneCodeEmptyError(request=None)
|
||||||
|
|
||||||
if sign_up:
|
if sign_up:
|
||||||
me = await self.sign_up(value, first_name, last_name)
|
me = await self.sign_up(value, first_name, last_name)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user