projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle 303 redirects
[akkoma]
/
lib
/
pleroma
/
captcha
/
kocaptcha.ex
diff --git
a/lib/pleroma/captcha/kocaptcha.ex
b/lib/pleroma/captcha/kocaptcha.ex
index 18931d5a07b19193822c8a941259564397e0aecf..4e1a07c596bcee16e4bf405aed785f178a2791de 100644
(file)
--- a/
lib/pleroma/captcha/kocaptcha.ex
+++ b/
lib/pleroma/captcha/kocaptcha.ex
@@
-3,6
+3,7
@@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Captcha.Kocaptcha do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Captcha.Kocaptcha do
+ import Pleroma.Web.Gettext
alias Pleroma.Captcha.Service
@behaviour Service
alias Pleroma.Captcha.Service
@behaviour Service
@@
-12,7
+13,7
@@
defmodule Pleroma.Captcha.Kocaptcha do
case Tesla.get(endpoint <> "/new") do
{:error, _} ->
case Tesla.get(endpoint <> "/new") do
{:error, _} ->
- %{error:
"Kocaptcha service unavailable"
}
+ %{error:
dgettext("errors", "Kocaptcha service unavailable")
}
{:ok, res} ->
json_resp = Jason.decode!(res.body)
{:ok, res} ->
json_resp = Jason.decode!(res.body)
@@
-32,6
+33,6
@@
defmodule Pleroma.Captcha.Kocaptcha do
if not is_nil(captcha) and
:crypto.hash(:md5, captcha) |> Base.encode16() == String.upcase(answer_data),
do: :ok,
if not is_nil(captcha) and
:crypto.hash(:md5, captcha) |> Base.encode16() == String.upcase(answer_data),
do: :ok,
- else: {:error,
"Invalid CAPTCHA"
}
+ else: {:error,
dgettext("errors", "Invalid CAPTCHA")
}
end
end
end
end