aboutsummaryrefslogtreecommitdiff
path: root/lib/recaptcha.ex
diff options
context:
space:
mode:
authorSamuel Seay <sam@manuka.co>2016-09-05 21:47:05 +1200
committerSamuel Seay <sam@manuka.co>2016-09-05 21:47:05 +1200
commit4198a89103dd5eac3b44fb2adc43b485aaf43e25 (patch)
treeab4521b420150a71ea4e7b303cb23e7157028e9f /lib/recaptcha.ex
parenta8da396dfc04e31854272d462e910a6c0ac35910 (diff)
downloadrecaptcha-4198a89103dd5eac3b44fb2adc43b485aaf43e25.tar.gz
recaptcha-4198a89103dd5eac3b44fb2adc43b485aaf43e25.tar.xz
Add the case for when a recaptcha challenge fails but the request succeeds.2.0
Diffstat (limited to 'lib/recaptcha.ex')
-rw-r--r--lib/recaptcha.ex2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/recaptcha.ex b/lib/recaptcha.ex
index 9e6be0f..30a5bd8 100644
--- a/lib/recaptcha.ex
+++ b/lib/recaptcha.ex
@@ -41,6 +41,8 @@ defmodule Recaptcha do
{:error, Enum.map(errors, fn(error) -> atomise_api_error(error) end)}
{:ok, %{"success" => true, "challenge_ts" => timestamp, "hostname" => host}} ->
{:ok, %Recaptcha.Response{challenge_ts: timestamp, hostname: host}}
+ {:ok, %{"success" => false, "challenge_ts" => timestamp, "hostname" => host}} ->
+ {:error, [:challenge_failed]}
end
end