allowGuestSearching config .. second attempt

This commit is contained in:
akhoury
2013-12-11 22:50:36 -05:00
parent 65d5a6cb81
commit 114294e24a
9 changed files with 116 additions and 39 deletions

View File

@@ -379,7 +379,7 @@ var path = require('path'),
// Basic Routes (entirely client-side parsed, goal is to move the rest of the crap in this file into this one section)
(function () {
var routes = ['login', 'register', 'account', 'recent', '403', '404', '500'],
loginRequired = ['unread', 'search', 'notifications'];
loginRequired = ['unread', 'notifications'];
async.each(routes.concat(loginRequired), function(route, next) {
app.get('/' + route, function (req, res) {
@@ -741,7 +741,7 @@ var path = require('path'),
});
app.get('/search/:term', function (req, res) {
if (!req.user) {
if (!req.user && !meta.config.allowGuestSearching) {
return res.redirect('/403');
}