mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 08:25:46 +01:00
403 all guests on /search & /search/term regardless of mobile/desktop - closes #612
This commit is contained in:
@@ -215,6 +215,7 @@ var path = require('path'),
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.get('/search', function (req, res) {
|
app.get('/search', function (req, res) {
|
||||||
|
if (req.user && req.user.uid) {
|
||||||
return res.json({
|
return res.json({
|
||||||
show_no_topics: 'hide',
|
show_no_topics: 'hide',
|
||||||
show_no_posts: 'hide',
|
show_no_posts: 'hide',
|
||||||
@@ -223,6 +224,9 @@ var path = require('path'),
|
|||||||
posts: [],
|
posts: [],
|
||||||
topics: []
|
topics: []
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
res.send(403);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get('/search/:term', function (req, res, next) {
|
app.get('/search/:term', function (req, res, next) {
|
||||||
@@ -254,6 +258,7 @@ var path = require('path'),
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (req.user && req.user.uid) {
|
||||||
async.parallel([searchPosts, searchTopics], function (err, results) {
|
async.parallel([searchPosts, searchTopics], function (err, results) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return next();
|
return next();
|
||||||
@@ -268,6 +273,9 @@ var path = require('path'),
|
|||||||
topics: results[1]
|
topics: results[1]
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
res.send(403);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get('/reset', function (req, res) {
|
app.get('/reset', function (req, res) {
|
||||||
|
|||||||
Reference in New Issue
Block a user