Skip to content

Commit

Permalink
Use request.uri instead of request.path as default redirect for auth.py.
Browse files Browse the repository at this point in the history
This allows the next parameter (added by @authenticated) to be preserved.

Closes tornadoweb#161.
  • Loading branch information
bdarnell committed Nov 29, 2010
1 parent 6151498 commit 96ecb66
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tornado/auth.py
Expand Up @@ -77,7 +77,7 @@ def authenticate_redirect(self, callback_uri=None,
all those attributes for your app, you can request fewer with
the ax_attrs keyword argument.
"""
callback_uri = callback_uri or self.request.path
callback_uri = callback_uri or self.request.uri
args = self._openid_args(callback_uri, ax_attrs=ax_attrs)
self.redirect(self._OPENID_ENDPOINT + "?" + urllib.urlencode(args))

Expand Down Expand Up @@ -280,7 +280,7 @@ def _oauth_request_token_url(self, callback_uri= None, extra_params=None):
signature = _oauth10a_signature(consumer_token, "GET", url, args)
else:
signature = _oauth_signature(consumer_token, "GET", url, args)

args["oauth_signature"] = signature
return url + "?" + urllib.urlencode(args)

Expand Down Expand Up @@ -326,7 +326,7 @@ def _on_access_token(self, callback, response):
logging.warning("Could not fetch access token")
callback(None)
return

access_token = _oauth_parse_response(response.body)
user = self._oauth_get_user(access_token, self.async_callback(
self._on_oauth_get_user, access_token, callback))
Expand Down Expand Up @@ -703,7 +703,7 @@ def authorize_redirect(self, oauth_scope, callback_uri=None,
You can authorize multiple resources by separating the resource
URLs with a space.
"""
callback_uri = callback_uri or self.request.path
callback_uri = callback_uri or self.request.uri
args = self._openid_args(callback_uri, ax_attrs=ax_attrs,
oauth_scope=oauth_scope)
self.redirect(self._OPENID_ENDPOINT + "?" + urllib.urlencode(args))
Expand Down Expand Up @@ -771,7 +771,7 @@ def authenticate_redirect(self, callback_uri=None, cancel_uri=None,
extended_permissions=None):
"""Authenticates/installs this app for the current user."""
self.require_setting("facebook_api_key", "Facebook Connect")
callback_uri = callback_uri or self.request.path
callback_uri = callback_uri or self.request.uri
args = {
"api_key": self.settings["facebook_api_key"],
"v": "1.0",
Expand Down

0 comments on commit 96ecb66

Please sign in to comment.