duplicate route removed: /users redirected to /users/online

v1.18.x
psychobunny 10 years ago
parent 0e0d8474a4
commit 671f96f589

@ -14,6 +14,10 @@ var async = require('async'),
db = require('../database'), db = require('../database'),
helpers = require('./helpers'); helpers = require('./helpers');
usersController.redirectToOnlineUsers = function(req, res, next) {
helpers.redirect(res, '/users/online');
};
usersController.getOnlineUsers = function(req, res, next) { usersController.getOnlineUsers = function(req, res, next) {
var websockets = require('../socket.io'); var websockets = require('../socket.io');

@ -78,7 +78,7 @@ function accountRoutes(app, middleware, controllers) {
function userRoutes(app, middleware, controllers) { function userRoutes(app, middleware, controllers) {
var middlewares = [middleware.checkGlobalPrivacySettings]; var middlewares = [middleware.checkGlobalPrivacySettings];
setupPageRoute(app, '/users', middleware, middlewares, controllers.users.getOnlineUsers); setupPageRoute(app, '/users', middleware, middlewares, controllers.users.redirectToOnlineUsers);
setupPageRoute(app, '/users/online', middleware, middlewares, controllers.users.getOnlineUsers); setupPageRoute(app, '/users/online', middleware, middlewares, controllers.users.getOnlineUsers);
setupPageRoute(app, '/users/sort-posts', middleware, middlewares, controllers.users.getUsersSortedByPosts); setupPageRoute(app, '/users/sort-posts', middleware, middlewares, controllers.users.getUsersSortedByPosts);
setupPageRoute(app, '/users/sort-reputation', middleware, middlewares, controllers.users.getUsersSortedByReputation); setupPageRoute(app, '/users/sort-reputation', middleware, middlewares, controllers.users.getUsersSortedByReputation);

Loading…
Cancel
Save