mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-26 00:21:16 +01:00
fix: gate /world behind ensureLoggedIn middleware
This commit is contained in:
@@ -16,10 +16,6 @@ const helpers = require('../helpers');
|
||||
const controller = module.exports;
|
||||
|
||||
controller.list = async function (req, res) {
|
||||
if (!req.uid) {
|
||||
return helpers.redirect(res, '/recent?cid=-1', false);
|
||||
}
|
||||
|
||||
const { topicsPerPage } = await user.getSettings(req.uid);
|
||||
const page = parseInt(req.query.page, 10) || 1;
|
||||
const start = Math.max(0, (page - 1) * topicsPerPage);
|
||||
|
||||
@@ -6,6 +6,7 @@ module.exports = function (app, middleware, controllers) {
|
||||
helpers.setupPageRoute(app, '/world', [
|
||||
middleware.activitypub.enabled,
|
||||
middleware.activitypub.pageview,
|
||||
middleware.ensureLoggedIn,
|
||||
], controllers.activitypub.topics.list);
|
||||
helpers.setupPageRoute(app, '/ap', [
|
||||
middleware.activitypub.enabled,
|
||||
|
||||
Reference in New Issue
Block a user