Skip to content

Commit

Permalink
require_oauth decorator was always succeeding.
Browse files Browse the repository at this point in the history
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/ib-lundgren#3
  • Loading branch information
datalogics-kam committed Mar 29, 2013
1 parent 3cb6d5e commit f56c268
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flask_oauthprovider.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,15 @@ 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,
require_resource_owner=require_resource_owner,
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)

Expand Down

0 comments on commit f56c268

Please sign in to comment.