mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36: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;
|
const uid = req.params.uid || res.locals.uid;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
((utils.isNumber(uid) || activitypub.helpers.isUri(uid)) && await user.exists(uid)) ||
|
uid !== -2 && // exposeUid middleware was in chain (means route is local user only) and resolved to fediverse user
|
||||||
(uid.indexOf('@') !== -1 && await user.existsBySlug(uid))
|
(((utils.isNumber(uid) || activitypub.helpers.isUri(uid)) && await user.exists(uid)) ||
|
||||||
|
(uid.indexOf('@') !== -1 && await user.existsBySlug(uid)))
|
||||||
) {
|
) {
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user