From bcfdbf7c97b275eabdf30247daf16a47ffec0431 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 23 Feb 2026 13:37:01 -0500 Subject: [PATCH] fix: gate /world behind ensureLoggedIn middleware --- src/controllers/activitypub/topics.js | 4 ---- src/routes/activitypub.js | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) 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,