mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-03 19:11:22 +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;
|
const controller = module.exports;
|
||||||
|
|
||||||
controller.list = async function (req, res) {
|
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 { topicsPerPage } = await user.getSettings(req.uid);
|
||||||
const page = parseInt(req.query.page, 10) || 1;
|
const page = parseInt(req.query.page, 10) || 1;
|
||||||
const start = Math.max(0, (page - 1) * topicsPerPage);
|
const start = Math.max(0, (page - 1) * topicsPerPage);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ module.exports = function (app, middleware, controllers) {
|
|||||||
helpers.setupPageRoute(app, '/world', [
|
helpers.setupPageRoute(app, '/world', [
|
||||||
middleware.activitypub.enabled,
|
middleware.activitypub.enabled,
|
||||||
middleware.activitypub.pageview,
|
middleware.activitypub.pageview,
|
||||||
|
middleware.ensureLoggedIn,
|
||||||
], controllers.activitypub.topics.list);
|
], controllers.activitypub.topics.list);
|
||||||
helpers.setupPageRoute(app, '/ap', [
|
helpers.setupPageRoute(app, '/ap', [
|
||||||
middleware.activitypub.enabled,
|
middleware.activitypub.enabled,
|
||||||
|
|||||||
Reference in New Issue
Block a user