mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 05:37:22 +01:00
fix(chat): validate group membership, by @phillipthelen
This commit is contained in:
@@ -295,7 +295,7 @@ api.likeChat = {
|
||||
const group = await Group.getGroup({ user, groupId });
|
||||
if (!group) throw new NotFound(res.t('groupNotFound'));
|
||||
|
||||
const message = await Chat.findOne({ _id: req.params.chatId }).exec();
|
||||
const message = await Chat.findOne({ _id: req.params.chatId, groupId: group._id }).exec();
|
||||
if (!message) throw new NotFound(res.t('messageGroupChatNotFound'));
|
||||
if (!message.likes) message.likes = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user