Fix rematch process
[vchess.git] / server / routes / games.js
index 21aee47..a86a76d 100644 (file)
@@ -12,7 +12,7 @@ router.post("/games", access.logged, access.ajax, (req,res) => {
   const cid = req.body.cid;
   if (
     Array.isArray(gameInfo.players) &&
-    gameInfo.players.some(p => p.id == req.userId) &&
+    gameInfo.players.some(p => p.uid == req.userId) &&
     (!cid || cid.toString().match(/^[0-9]+$/)) &&
     GameModel.checkGameInfo(gameInfo)
   ) {