@ -831,7 +831,12 @@ post "/login" do |env|
begin
validate_response(challenge, token, answer, "sign_in", HMAC_KEY, PG_DB)
rescue ex
error_message = ex.message
if ex.message && ex.message == "Invalid user"
error_message = "Invalid CAPTCHA response"
else
end
next templated "error"
@ -251,7 +251,7 @@ def validate_response(challenge, token, user_id, operation, key, db)
if challenge_user_id != user_id
raise "Invalid token"
raise "Invalid user"
if expire < Time.now.to_unix