mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-03 11:01:20 +01:00
fix: send guests to login page if they access uncategorized topics without local posts
This commit is contained in:
@@ -53,12 +53,16 @@ topicsController.get = async function getTopic(req, res, next) {
|
||||
if (
|
||||
userPrivileges.disabled ||
|
||||
invalidPagination ||
|
||||
(topicData.scheduled && !userPrivileges.view_scheduled) ||
|
||||
await shouldHideTopicFromGuest(req.uid, tid, topicData.cid)) {
|
||||
(topicData.scheduled && !userPrivileges.view_scheduled)
|
||||
) {
|
||||
return next();
|
||||
}
|
||||
|
||||
if (!userPrivileges['topics:read'] || (!topicData.scheduled && topicData.deleted && !userPrivileges.view_deleted)) {
|
||||
if (
|
||||
!userPrivileges['topics:read'] ||
|
||||
(!topicData.scheduled && topicData.deleted && !userPrivileges.view_deleted) ||
|
||||
await shouldHideTopicFromGuest(req.uid, tid, topicData.cid)
|
||||
) {
|
||||
return helpers.notAllowed(req, res);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user