Modified check_token function to account for multiple objects being posted via JSON. Resolves issue with it throwing an error when it encounters a list instead of a dict type.

This commit is contained in:
Derek Rushing
2015-02-18 10:20:22 -06:00
parent c7d0ea9cce
commit 4debc8d102
+2 -1
View File
@@ -52,7 +52,8 @@ def _check_token():
header_token = request.headers.get(header_key, None)
token = request.args.get(args_key, header_token)
if request.get_json(silent=True):
token = request.json.get(args_key, token)
if not isinstance(request.json, list):
token = request.json.get(args_key, token)
user = _security.login_manager.token_callback(token)