]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Support passing in cookie value directly in cases where you have to parse the value...
authorBret Taylor <btaylor@gmail.com>
Fri, 5 Feb 2010 18:24:57 +0000 (10:24 -0800)
committerBret Taylor <btaylor@gmail.com>
Fri, 5 Feb 2010 18:24:57 +0000 (10:24 -0800)
tornado/auth.py
tornado/web.py

index a88451555a9c199f8b2e2b19dfbf5d69eaa00f31..ca352b3b7411ca1a0407aafe6d10ab2ab9557b45 100644 (file)
@@ -676,7 +676,7 @@ class FacebookMixin(object):
                           tornado.auth.FacebookMixin):
         @tornado.web.asynchronous
         def get(self):
-            if self.get_argument("auth_token", None):
+            if self.get_argument("session", None):
                 self.get_authenticated_user(self.async_callback(self._on_auth))
                 return
             self.authenticate_redirect()
index 403c25cb8c8aed3c244df4bbc842a6797e5a99e4..55c6816af394adf67d503dcccb44e5a49ec1847c 100644 (file)
@@ -266,7 +266,7 @@ class RequestHandler(object):
         value = "|".join([value, timestamp, signature])
         self.set_cookie(name, value, expires_days=expires_days, **kwargs)
 
-    def get_secure_cookie(self, name, include_name=True):
+    def get_secure_cookie(self, name, include_name=True, value=None):
         """Returns the given signed cookie if it validates, or None.
 
         In older versions of Tornado (0.1 and 0.2), we did not include the
@@ -276,7 +276,7 @@ class RequestHandler(object):
         your users out whose cookies were written with a previous Tornado
         version).
         """
-        value = self.get_cookie(name)
+        if value is None: value = self.get_cookie(name)
         if not value: return None
         parts = value.split("|")
         if len(parts) != 3: return None