     if routeInfo.authenticated && !req.appContext.loggedIn()
       res.redirect('/login')
     else
-      config.stashPerf(req, "authenticate", new Date - start)
+      stashPerf(req, "authenticate", new Date - start)
       next()
+
+afterRender = () ->
+  (req, res, next) ->
+    if (config && config.afterRender)
+      config.afterRender(req, res)
+    # DO NOT CALL NEXT!  END FILTER CHAIN HERE
 
 # config
 # - stashError(req, err)

      throw err
    else
      res.render('error_view', app: req.appContext, req: req);

getAuthenticate = (routeInfo) ->
  (req, res, next) ->

    action = getAction(routeInfo)
    handler = getHandler(action)
    authenticate = getAuthenticate(routeInfo)
    routeSpecs.push(['get', "/#{path}", authenticate, handler, afterRender()])

  routeSpecs
