[Plugin] auth: Handle exception if data is not json
This commit is contained in:
parent
79c05fa2f4
commit
67fb895cf4
|
@ -36,7 +36,7 @@ def login():
|
|||
try:
|
||||
userid = data["userid"]
|
||||
password = data["password"]
|
||||
except KeyError:
|
||||
except (KeyError, ValueError):
|
||||
raise BadRequest("Missing parameter(s)")
|
||||
|
||||
logger.debug("search user {{ {} }} in database".format(userid))
|
||||
|
|
Loading…
Reference in New Issue