[Plugin]auth: Fixed possible issue with POST paramenters on login
This commit is contained in:
parent
4a4930d683
commit
737dd9d5cf
|
@ -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):
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue