mirror of
https://github.com/librecaptcha/lc-core.git
synced 2025-01-12 22:43:20 -05:00
gracefully handle wrong input from API
This commit is contained in:
parent
644a106a31
commit
239bf2cefc
@ -110,10 +110,13 @@ class Captcha(throttle: Int) extends DBConn {
|
||||
def checkAnswer(answer: Answer): Boolean = {
|
||||
selectPstmt.setString(1, answer.id)
|
||||
val rs: ResultSet = selectPstmt.executeQuery()
|
||||
rs.next()
|
||||
val secret = rs.getString("secret")
|
||||
val provider = rs.getString("provider")
|
||||
providers(provider).checkAnswer(secret, answer.answer)
|
||||
if (rs.first()) {
|
||||
val secret = rs.getString("secret")
|
||||
val provider = rs.getString("provider")
|
||||
providers(provider).checkAnswer(secret, answer.answer)
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
def getHash(email: String): Int = {
|
||||
|
Loading…
Reference in New Issue
Block a user