docs: function (req, res, next) {
      if (vulpejs.app.security.ignore) {
        exports.auth.checkAfter(req, res, next);
        return;
      }
      if (!req.cookies.appLanguage || req.cookies.appLanguage === 'undefined') {
        res.cookie('appLanguage', 'pt');
      }
      var skip = false;
      for (var i = 0, len = loginSkip.length; i < len; ++i) {
        var skipUri = vulpejs.app.root.context + loginSkip[i];
        if (skipUri === req.originalUrl || (skipUri !== '/' && req.originalUrl.indexOf(skipUri) === 0)) {
          skip = true;
          break;
        }
      }
      if (!req.isAuthenticated()) {
        if (!skip) {
          req.session['redirect-to'] = req.originalUrl;
          res.redirect(vulpejs.app.root.context + '/login');
          return;
        }
        exports.auth.checkAfter(req, res, next);
      } else {
        var roles = req.session['user-roles'];
        if (skip || !roles || roles.length === 0 || !vulpejs.app.security.routes || vulpejs.app.security.routes.length === 0) {
          exports.auth.checkAfter(req, res, next);
          return;
        }
        var hasRouteRoles = function (route) {
          if (route === '') {
            return false;
          }
          var roleExists = !route.roles || route.roles.length === 0;
          if (!roleExists) {
            for (var i = 0, len = roles.length; i < len; ++i) {
              if (route.roles.indexOf(roles[i]) !== -1) {
                roleExists = true;
                break;
              }
            }
          }
          return roleExists;
        };
        var routeWildcard = '';
        var requestedRoute = '';
        var roleExists = false;
        var routeExists = false;
        var routes = vulpejs.app.security.routes.length;
        var uriCheck = function (value) {
          return (value === '/' && req.originalUrl === value) || (value !== '/' && req.originalUrl.indexOf(value) === 0);
        };
        for (var i = 0; i < routes; ++i) {
          var route = vulpejs.app.security.routes[i];
          if (route.uris && Array.isArray(route.uris)) {
            for (var j = 0; j < route.uris.length; ++j) {
              if (uriCheck(route.uris[j])) {
                requestedRoute = route;
                break;
              }
            }
          } else if (route.uri === '/**') {
            routeWildcard = route;
          } else if (uriCheck(route.uri)) {
            requestedRoute = route;
          }
          if (requestedRoute) {
            break;
          }
        }
        if (((requestedRoute === '' && routeWildcard === '') || hasRouteRoles(requestedRoute)) || (routeWildcard !== '' && hasRouteRoles(routeWildcard))) {
          exports.auth.checkAfter(req, res, next);
        } else {
          res.status(403);
          exports.render(res, 'error', {
            ui: {
              controller: 'Error',
            },
            error: {
              status: 403,
              message: 'Forbidden',
            },
          });
        }
      }
    }