[Plugin]auth: Fixed possible issue with POST paramenters on login

This commit is contained in:
Ferdinand Thiessen 2020-11-18 02:48:44 +01:00
parent 4a4930d683
commit 737dd9d5cf
2 changed files with 4 additions and 4 deletions

View File

@ -68,7 +68,7 @@ class User(db.Model, ModelSerializeMixin):
@property
def avatar_url(self):
return url_for('users.get_avatar', userid=self.userid)
return url_for("users.get_avatar", userid=self.userid)
@property
def roles(self):

View File

@ -34,9 +34,9 @@ def login():
logger.debug("Start log in.")
data = request.get_json()
try:
userid = data["userid"]
password = data["password"]
except (KeyError, ValueError):
userid = str(data["userid"])
password = str(data["password"])
except (KeyError, ValueError, TypeError):
raise BadRequest("Missing parameter(s)")
logger.debug("search user {{ {} }} in database".format(userid))