From 5249a1784727af20825ef833161935d901435d81 Mon Sep 17 00:00:00 2001 From: "Kevin A. Mitchell" Date: Thu, 28 Mar 2013 20:41:31 -0500 Subject: [PATCH] require_oauth decorator was always succeeding. verify_request() returns a tuple of (valid, oauth_request). The code was treating it as if it returned just a bool, and since the never-empty tuple was always truthy, requests always seemed to work. Fixes ib-lundgren/flask-oauthprovider/#3 --- flask_oauthprovider.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flask_oauthprovider.py b/flask_oauthprovider.py index 0c9bbf0..cf337c9 100644 --- a/flask_oauthprovider.py +++ b/flask_oauthprovider.py @@ -275,7 +275,7 @@ def verify_request(*args, **kwargs): body = request.form.to_dict() else: body = request.data.decode("utf-8") - valid = self.verify_request(request.url.decode("utf-8"), + verify_result = self.verify_request(request.url.decode("utf-8"), http_method=request.method.decode("utf-8"), body=body, headers=request.headers, @@ -283,6 +283,7 @@ def verify_request(*args, **kwargs): require_verifier=require_verifier, require_realm=require_realm or bool(realm), required_realm=realm) + valid, oauth_request = verify_result if valid: request.oauth = self.collect_request_parameters(request)