Fix signalmaster query to check participant

master
Daniel Berteaud 10 years ago
parent 85da128bff
commit c380c4812c
  1. 2
      signalmaster/server.js

@ -38,7 +38,7 @@ function safeCb(cb) {
}
function checkRoom(room,token,user,cb) {
var q = "SELECT `participant` FROM `participants` WHERE `participant`=" + sql.escape(user) + " AND `id` IN (SELECT `id` FROM `rooms` WHERE `name`=" + sql.escape(room) + " AND `token`=" + sql.escape(token) + ");";
var q = "SELECT `participant` FROM `participants` WHERE `participant`=" + sql.escape(user) + " AND `room_id` IN (SELECT `id` FROM `rooms` WHERE `name`=" + sql.escape(room) + " AND `token`=" + sql.escape(token) + ");";
console.log('Checking if ' + user + ' is allowed to join room ' + room + ' using token ' + token);
sql.query(q, function(err, rows, fields) {
if (err){

Loading…
Cancel
Save