[mirotalk] - add isRoomActive

This commit is contained in:
Miroslav Pejic
2025-08-06 01:54:49 +02:00
parent d27a1c64a8
commit 457fd2f2b6
+13
View File
@@ -594,6 +594,19 @@ app.get(['/icetest'], (req, res) => {
res.sendFile(views.stunTurn);
});
// Check if room active (exists)
app.post('/isRoomActive', (req, res) => {
const { roomId } = checkXSS(req.body);
if (roomId && (hostCfg.protected || hostCfg.user_auth || OIDC.enabled)) {
const roomActive = Object.prototype.hasOwnProperty.call(peers, roomId);
if (roomActive) log.debug('isRoomActive', { roomId, roomActive });
res.status(200).json({ message: roomActive });
} else {
res.status(400).json({ message: 'Unauthorized' });
}
});
// Handle Direct join room with params
app.get('/join/', async (req, res) => {
if (Object.keys(req.query).length > 0) {