From 4debc8d1028484fe9fddd21d67ce7fff20e8eb40 Mon Sep 17 00:00:00 2001 From: Derek Rushing Date: Wed, 18 Feb 2015 10:20:22 -0600 Subject: [PATCH] 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. --- flask_security/decorators.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flask_security/decorators.py b/flask_security/decorators.py index 3363fc5..34c3f7d 100644 --- a/flask_security/decorators.py +++ b/flask_security/decorators.py @@ -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)