[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
|
@property
|
||||||
def avatar_url(self):
|
def avatar_url(self):
|
||||||
return url_for('users.get_avatar', userid=self.userid)
|
return url_for("users.get_avatar", userid=self.userid)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def roles(self):
|
def roles(self):
|
||||||
|
|
|
@ -34,9 +34,9 @@ def login():
|
||||||
logger.debug("Start log in.")
|
logger.debug("Start log in.")
|
||||||
data = request.get_json()
|
data = request.get_json()
|
||||||
try:
|
try:
|
||||||
userid = data["userid"]
|
userid = str(data["userid"])
|
||||||
password = data["password"]
|
password = str(data["password"])
|
||||||
except (KeyError, ValueError):
|
except (KeyError, ValueError, TypeError):
|
||||||
raise BadRequest("Missing parameter(s)")
|
raise BadRequest("Missing parameter(s)")
|
||||||
|
|
||||||
logger.debug("search user {{ {} }} in database".format(userid))
|
logger.debug("search user {{ {} }} in database".format(userid))
|
||||||
|
|
Loading…
Reference in New Issue