bug session_auth tool and url ending with "login_screen"

4 views
Skip to first unread message

Fabien

unread,
Jan 20, 2011, 5:59:46 AM1/20/11
to cherrypy-devel
Hi, I'm having a problem using the session_auth tool:
it seems to me that the url ending with "login_screen" doesn't work as
described in the doc. They should normally display the login form
page, but in my case (SVN version) it display a blank page.

The problem seems to come from cptools.py, in the method run from
SessionAuth class, I would change:
if path.endswith('login_screen'):
return self.login_screen(**request.params)

into

if path.endswith('login_screen'):
cherrypy.response.body =
self.login_screen(**request.params)
return True



my workaround for using current version is to add the following in my
code:

def session_auth_run_fix(self):
request = cherrypy.request
path = request.path_info
if path.endswith('login_screen'):
cherrypy.response.body = self.login_screen(**request.params)
return True
elif path.endswith('do_login'):
return self.do_login(**request.params)
elif path.endswith('do_logout'):
return self.do_logout(**request.params)
else:
return self.do_check()

import cherrypy.lib.cptools
cherrypy.lib.cptools.SessionAuth.run = session_auth_run_fix

Regards,
Fabien
Reply all
Reply to author
Forward
0 new messages