fix: bad logic that invisibly broke outgoing user follows completely

This commit is contained in:
Julian Lam
2025-02-02 03:27:54 -05:00
parent 0298a3af0d
commit 334be72179

View File

@@ -38,7 +38,7 @@ function enabledCheck(next) {
activitypubApi.follow = enabledCheck(async (caller, { type, id, actor } = {}) => { activitypubApi.follow = enabledCheck(async (caller, { type, id, actor } = {}) => {
// Privilege checks should be done upstream // Privilege checks should be done upstream
const assertion = await activitypub.actors.assert(actor); const assertion = await activitypub.actors.assert(actor);
if (!assertion || !assertion.length) { if (!assertion || (Array.isArray(assertion) && assertion.length)) {
throw new Error('[[error:activitypub.invalid-id]]'); throw new Error('[[error:activitypub.invalid-id]]');
} }