mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: crash when AP S2S call made to retrieve a remote user account (not allowed); now returning 404
This commit is contained in:
@@ -29,8 +29,9 @@ Assert.user = helpers.try(async (req, res, next) => {
|
||||
const uid = req.params.uid || res.locals.uid;
|
||||
|
||||
if (
|
||||
((utils.isNumber(uid) || activitypub.helpers.isUri(uid)) && await user.exists(uid)) ||
|
||||
(uid.indexOf('@') !== -1 && await user.existsBySlug(uid))
|
||||
uid !== -2 && // exposeUid middleware was in chain (means route is local user only) and resolved to fediverse user
|
||||
(((utils.isNumber(uid) || activitypub.helpers.isUri(uid)) && await user.exists(uid)) ||
|
||||
(uid.indexOf('@') !== -1 && await user.existsBySlug(uid)))
|
||||
) {
|
||||
return next();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user