web/application.py
branchstable
changeset 4911 898c35be5873
parent 4709 6a71fc0b4274
child 4914 dcb055f32d9b
equal deleted inserted replaced
4910:f40fddaa79ad 4911:898c35be5873
   215         path = req.relative_path(False)
   215         path = req.relative_path(False)
   216         if path == 'login':
   216         if path == 'login':
   217             path = 'view'
   217             path = 'view'
   218         raise Redirect(req.build_url(path, **args))
   218         raise Redirect(req.build_url(path, **args))
   219 
   219 
   220     def logout(self, req):
   220     def logout(self, req, goto_url):
   221         """logout from the instance by cleaning the session and raising
   221         """logout from the instance by cleaning the session and raising
   222         `AuthenticationError`
   222         `AuthenticationError`
   223         """
   223         """
   224         self.session_manager.close_session(req.cnx)
   224         self.session_manager.close_session(req.cnx)
   225         req.remove_cookie(req.get_cookie(), self.SESSION_VAR)
   225         req.remove_cookie(req.get_cookie(), self.SESSION_VAR)
   226         raise AuthenticationError()
   226         raise AuthenticationError(url=goto_url)
   227 
   227 
   228 
   228 
   229 class CubicWebPublisher(object):
   229 class CubicWebPublisher(object):
   230     """the publisher is a singleton hold by the web frontend, and is responsible
   230     """the publisher is a singleton hold by the web frontend, and is responsible
   231     to publish HTTP request.
   231     to publish HTTP request.