mirror of
https://github.com/wassname/flask-security.git
synced 2026-06-27 16:10:11 +08:00
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user