mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 20:45:58 +01:00
fix: reject accepts of invalid follows and return when already following
This commit is contained in:
@@ -256,7 +256,8 @@ inbox.accept = async (req) => {
|
||||
|
||||
if (type === 'Follow') {
|
||||
if (!await db.isSortedSetMember(`followRequests:${uid}`, actor)) {
|
||||
throw new Error('[[error:activitypub.get-failed]]');
|
||||
if (await db.isSortedSetMember(`followingRemote:${uid}`, actor)) return; // already following
|
||||
return reject('Accept', req.body, actor); // not following, not requested, so reject to hopefully stop retries
|
||||
}
|
||||
const now = Date.now();
|
||||
await Promise.all([
|
||||
|
||||
Reference in New Issue
Block a user