Use cherrypy handlers to render error pages
[cascardo/ipsilon.git] / ipsilon / login / common.py
index 5879fda..4ffdd8a 100755 (executable)
@@ -56,9 +56,8 @@ class LoginManagerBase(PluginObject):
 
         # otherwise destroy session and return error
         if not ref:
-            ref = cherrypy.config.get('base.mount', "") + '/unauthorized'
-            # Just make sure we destroy the session
             session.logout(None)
+            raise cherrypy.HTTPError(401)
 
         raise cherrypy.HTTPRedirect(ref)