select a random captcha

This commit is contained in:
hrj 2020-07-03 22:14:33 +05:30
parent fd5dcff335
commit 80ff9bfe6d

View File

@ -89,7 +89,7 @@ class Captcha(throttle: Int) extends DBConn {
}
def getChallenge(param: Parameters): Id = {
val rs = stmt.executeQuery("SELECT token FROM challenge WHERE solved=FALSE LIMIT 1")
val rs = stmt.executeQuery("SELECT token FROM challenge WHERE solved=FALSE ORDER BY RAND() LIMIT 1")
val id = if(rs.next()){
rs.getString("token")
} else {