1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-09 20:22:47 +01:00

Check nonce in Message send

This commit is contained in:
Madeline 2022-10-05 01:17:00 +11:00
parent 685f87703a
commit f35c8a1f49
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47

View File

@ -201,6 +201,19 @@ router.post(
);
}
if (body.nonce) {
const existing = await Message.findOne({
where: {
nonce: body.nonce,
channel_id: channel.id,
author_id: req.user_id
}
});
if (existing) {
return res.json(existing);
}
}
const files = (req.files as Express.Multer.File[]) ?? [];
for (var currFile of files) {
try {