Return error if user tries to send empty login code to API

This commit is contained in:
Tulir Asokan
2022-02-09 12:05:16 +02:00
parent 7950c5aa61
commit 2fb08d59c7
3 changed files with 23 additions and 8 deletions
+2 -1
View File
@@ -195,7 +195,8 @@ class User(DBUser, AbstractUser, BaseUser):
if self.tgid:
await self.push_bridge_state(BridgeStateEvent.UNKNOWN_ERROR, message=str(e))
except UnauthorizedError as e:
self.log.error(f"Authorization error in start(): {type(e)}: {e}")
if delete_unless_authenticated or self.tgid:
self.log.error(f"Authorization error in start(): {type(e)}: {e}")
if self.tgid:
await self.push_bridge_state(
BridgeStateEvent.BAD_CREDENTIALS,