]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
allows the TwitterMixin define the callback_uri, that solves issue #377 378/head
authorGuto Maia <guto@guto.net>
Fri, 7 Oct 2011 19:21:10 +0000 (16:21 -0300)
committerGuto Maia <guto@guto.net>
Fri, 7 Oct 2011 19:21:10 +0000 (16:21 -0300)
tornado/auth.py

index b9f7f57da130a75fa84aebe6566315ecfac9e399..5701bee400bac8da84085b4f4d872e82bd2d0459 100644 (file)
@@ -451,14 +451,14 @@ class TwitterMixin(OAuthMixin):
     _OAUTH_NO_CALLBACKS = False
 
 
-    def authenticate_redirect(self):
+    def authenticate_redirect(self, callback_uri = None):
         """Just like authorize_redirect(), but auto-redirects if authorized.
 
         This is generally the right interface to use if you are using
         Twitter for single-sign on.
         """
         http = httpclient.AsyncHTTPClient()
-        http.fetch(self._oauth_request_token_url(), self.async_callback(
+        http.fetch(self._oauth_request_token_url(callback_uri = callback_uri), self.async_callback(
             self._on_request_token, self._OAUTH_AUTHENTICATE_URL, None))
 
     def twitter_request(self, path, callback, access_token=None,