Index: main.py
===================================================================
--- main.py	(revision 5453)
+++ main.py	(working copy)
@@ -445,6 +445,8 @@
         data = {'title': title, 'type': 'TracError', 'message': e.detail,
                 'frames': [], 'traceback': None}
         try:
+            if (req.authname == 'anonymous') and (e.reason == 'Forbidden'):
+                req.redirect(env.href('login', {'referer':req.abs_href(req.path_info)}))
             req.send_error(sys.exc_info(), status=e.code, env=env, data=data)
         except RequestDone:
             return []

