mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-19 04:57:54 +01:00
fix: guard against negative uids crossposting
This commit is contained in:
@@ -84,6 +84,13 @@ describe('Crossposting (& related logic)', () => {
|
||||
tid = topicData.tid;
|
||||
});
|
||||
|
||||
it('should not allow a spider (uid -1) to crosspost', async () => {
|
||||
await assert.rejects(
|
||||
topics.crossposts.add(tid, cid2, -1),
|
||||
{ message: '[[error:invalid-uid]]' }
|
||||
);
|
||||
});
|
||||
|
||||
it('should successfully crosspost to another cid', async () => {
|
||||
const crossposts = await topics.crossposts.add(tid, cid2, uid);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user