mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-05 07:10:30 +01:00
Merge branch 'master' into develop
This commit is contained in:
@@ -14,8 +14,11 @@ followController.getFollowers = async function (req, res, next) {
|
||||
await getFollow('account/followers', 'followers', req, res, next);
|
||||
};
|
||||
|
||||
async function getFollow(tpl, name, req, res) {
|
||||
async function getFollow(tpl, name, req, res, next) {
|
||||
const { userData: payload } = res.locals;
|
||||
if (!payload) {
|
||||
return next();
|
||||
}
|
||||
const {
|
||||
username, userslug, followerCount, followingCount,
|
||||
} = payload;
|
||||
|
||||
@@ -260,6 +260,9 @@ module.exports = function (middleware) {
|
||||
}
|
||||
|
||||
res.locals.userData = await accountHelpers.getUserDataByUserSlug(req.params.userslug, req.uid, req.query);
|
||||
if (!res.locals.userData) {
|
||||
return next('route');
|
||||
}
|
||||
next();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user