Skip to content

Node.js based forum software built for the modern web

fix: gate /world behind ensureLoggedIn middleware

Julian Lambcfdbf7c97b2
diff --git a/src/controllers/activitypub/topics.js b/src/controllers/activitypub/topics.js
index d780f954c7..0e1fbe959a 100644
--- a/src/controllers/activitypub/topics.js
+++ b/src/controllers/activitypub/topics.js
@@ -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);
diff --git a/src/routes/activitypub.js b/src/routes/activitypub.js
index 6c13fea365..00d8b1a125 100644
--- a/src/routes/activitypub.js
+++ b/src/routes/activitypub.js
@@ -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,