[Zope-CVS] CVS: Products/PluggableAuthService/plugins - CookieAuthHelper.py:1.7.2.3

Zachery Bir zbir at urbanape.com
Fri Oct 15 11:30:38 EDT 2004


Update of /cvs-repository/Products/PluggableAuthService/plugins
In directory cvs.zope.org:/tmp/cvs-serv6231

Modified Files:
      Tag: pre-1_0_3-zbir-challenge-branch
	CookieAuthHelper.py 
Log Message:
Only write the cookie on a successful login - not when we're
extracting credentials


=== Products/PluggableAuthService/plugins/CookieAuthHelper.py 1.7.2.2 => 1.7.2.3 ===
--- Products/PluggableAuthService/plugins/CookieAuthHelper.py:1.7.2.2	Tue Oct 12 17:10:05 2004
+++ Products/PluggableAuthService/plugins/CookieAuthHelper.py	Fri Oct 15 11:30:37 2004
@@ -120,11 +120,6 @@
                 request.set('__ac_name', '')
                 request.set('__ac_password', '')
 
-                cookie_val = encodestring('%s:%s' % (login, password))
-                cookie_val = cookie_val.replace( '\n', '' )
-                response = request['RESPONSE']
-                response.setCookie(self.cookie_name, cookie_val, path='/')
-
         if creds:
             creds['remote_host'] = request.get('REMOTE_HOST', '')
 
@@ -146,7 +141,7 @@
     def updateCredentials(self, request, response, login, new_password):
         """ Respond to change of credentials (NOOP for basic auth). """
         cookie_val = encodestring('%s:%s' % (login, new_password))
-
+        cookie_val = cookie_val.replace( '\n', '' )
         response.setCookie(self.cookie_name, cookie_val, path='/')
 
 
@@ -211,6 +206,11 @@
         """
         request = self.REQUEST
         response = request['RESPONSE']
+
+        login = request.get('__ac_name', '')
+        password = request.get('__ac_password', '')
+
+        self.updateCredentials(request, response, login, password)
 
         came_from = request.form['came_from']
 



More information about the Zope-CVS mailing list