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') {