fix(endpoints) checkpassword endpoints checks for passwordhash and encryption

This commit is contained in:
Tanner Shaw
2023-11-11 14:09:28 -06:00
parent 214c24c3f0
commit ab430d167f

View File

@@ -276,10 +276,16 @@ router.post('/checkpasswordhash/:id', limiter, (req: Request, res: Response) =>
roomId: id
},
select: {
passwordHash: true
passwordHash: true,
encrypted: true
}
})
.then((room) => {
if (room && !room.passwordHash && room.encrypted === 'AES') {
res.status(200).json({ success: false, message: 'Room is not initialized, no password set' });
return;
}
if (room && room.passwordHash === passwordHash) {
res.status(200).json({ success: true });
} else {