diff --git a/src/main/scala/lc/core/captcha.scala b/src/main/scala/lc/core/captcha.scala index 385c6b1..a1b1760 100644 --- a/src/main/scala/lc/core/captcha.scala +++ b/src/main/scala/lc/core/captcha.scala @@ -96,7 +96,7 @@ object Captcha { token match { case Some(value) => { val uuid = getUUID(value) - updateAttempted(uuid) + updateAttempted(value) Right(Id(uuid)) } case None => { @@ -121,9 +121,9 @@ object Captcha { } } - private def updateAttempted(uuid: String): Unit = { + private def updateAttempted(token: Int): Unit = { val updateAttemptedPstmt = Statements.tlStmts.get.updateAttemptedPstmt - updateAttemptedPstmt.setString(1, uuid) + updateAttemptedPstmt.setInt(1, token) updateAttemptedPstmt.executeUpdate() } diff --git a/src/main/scala/lc/database/statements.scala b/src/main/scala/lc/database/statements.scala index d23d6e2..bffa420 100644 --- a/src/main/scala/lc/database/statements.scala +++ b/src/main/scala/lc/database/statements.scala @@ -64,10 +64,7 @@ class Statements(dbConn: DBConn, maxAttempts: Int) { val updateAttemptedPstmt: PreparedStatement = dbConn.con.prepareStatement( "UPDATE challenge " + "SET attempted = attempted+1 " + - "WHERE token = (SELECT m.token " + - "FROM mapId m, challenge c " + - "WHERE m.token=c.token AND " + - "m.uuid = ?)" + "WHERE token = ?;" ) val tokenPstmt: PreparedStatement = dbConn.con.prepareStatement(