From 6087f3c8cdb2c50fa0105f0d82e4d6512dd22c3f Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Tue, 25 Jul 2017 12:54:23 -0400 Subject: [PATCH] test router fix --- src/plugins.js | 6 +++--- src/routes/index.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins.js b/src/plugins.js index 9dbc5d04b9..57665cbe90 100644 --- a/src/plugins.js +++ b/src/plugins.js @@ -117,10 +117,10 @@ Plugins.reload = function (callback) { Plugins.reloadRoutes = function (callback) { var router = express.Router(); - var ensureLoggedIn = require('connect-ensure-login'); + // var ensureLoggedIn = require('connect-ensure-login'); - router.all('(/api/admin|/api/admin/*?)', middleware.isAdmin); - router.all('(/admin|/admin/*?)', ensureLoggedIn.ensureLoggedIn(nconf.get('relative_path') + '/login?local=1'), middleware.applyCSRF, middleware.isAdmin); + // router.all('(/api/admin|/api/admin/*?)', middleware.isAdmin); + // router.all('(/admin|/admin/*?)', ensureLoggedIn.ensureLoggedIn(nconf.get('relative_path') + '/login?local=1'), middleware.applyCSRF, middleware.isAdmin); router.hotswapId = 'plugins'; router.render = function () { diff --git a/src/routes/index.js b/src/routes/index.js index 9c933a63ca..f88ccb0f27 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -118,8 +118,8 @@ module.exports = function (app, middleware, hotswapIds, callback) { app.all(relativePath + '(/api/admin|/api/admin/*?)', middleware.isAdmin); app.all(relativePath + '(/admin|/admin/*?)', ensureLoggedIn.ensureLoggedIn(nconf.get('relative_path') + '/login?local=1'), middleware.applyCSRF, middleware.isAdmin); - router.all('(/api/admin|/api/admin/*?)', middleware.isAdmin); - router.all('(/admin|/admin/*?)', ensureLoggedIn.ensureLoggedIn(nconf.get('relative_path') + '/login?local=1'), middleware.applyCSRF, middleware.isAdmin); + // router.all('(/api/admin|/api/admin/*?)', middleware.isAdmin); + // router.all('(/admin|/admin/*?)', ensureLoggedIn.ensureLoggedIn(nconf.get('relative_path') + '/login?local=1'), middleware.applyCSRF, middleware.isAdmin); adminRoutes(router, middleware, controllers); metaRoutes(router, middleware, controllers); @@ -138,7 +138,7 @@ module.exports = function (app, middleware, hotswapIds, callback) { groupRoutes(router, middleware, controllers); for (x = 0; x < routers.length; x += 1) { - app.use(relativePath, routers[x]); + app.use(relativePath ? relativePath : '/', routers[x]); } if (process.env.NODE_ENV === 'development') {