From 886055c6429c5e73536d7bd11050c435c6105040 Mon Sep 17 00:00:00 2001 From: Rahul Rudragoudar Date: Sun, 9 Jun 2019 14:12:21 +0530 Subject: [PATCH] Update query to cross refernce uuid to token Signed-off-by: Rahul Rudragoudar --- src/main/scala/lc/Main.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/lc/Main.scala b/src/main/scala/lc/Main.scala index 412e27b..18e4753 100644 --- a/src/main/scala/lc/Main.scala +++ b/src/main/scala/lc/Main.scala @@ -29,7 +29,7 @@ class Captcha(throttle: Int) { val mapPstmt: PreparedStatement = con.prepareStatement("INSERT INTO mapId(uuid, token) VALUES (?, ?)") val selectPstmt: PreparedStatement = con.prepareStatement("SELECT secret, provider FROM challenge WHERE token = ?") val imagePstmt: PreparedStatement = con.prepareStatement("SELECT image FROM challenge c, mapId m WHERE c.token=m.token AND m.uuid = ?") - val updatePstmt: PreparedStatement = con.prepareStatement("UPDATE challenge c, mapId m SET c.solved = True WHERE c.token = m.token AND m.uuid = ?") + val updatePstmt: PreparedStatement = con.prepareStatement("UPDATE challenge SET solved = True WHERE token = (SELECT m.token FROM mapId m, challenge c WHERE m.token=c.token AND m.uuid = ?)") val userPstmt: PreparedStatement = con.prepareStatement("INSERT INTO users(email, hash) VALUES (?,?)") val providers = Map("FilterChallenge" -> new FilterChallenge,