projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MastoAPI: Show source field when deleting
[akkoma]
/
lib
/
pleroma
/
captcha
/
native.ex
diff --git
a/lib/pleroma/captcha/native.ex
b/lib/pleroma/captcha/native.ex
index 5306fe1aa13d4e470860b31b704c1a27c41b8972..a90631d61be6e66b78cfbf4b30886aa788849427 100644
(file)
--- a/
lib/pleroma/captcha/native.ex
+++ b/
lib/pleroma/captcha/native.ex
@@
-1,17
+1,16
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Captcha.Native do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Captcha.Native do
- import Pleroma.Web.Gettext
alias Pleroma.Captcha.Service
@behaviour Service
@impl Service
def new do
case Captcha.get() do
alias Pleroma.Captcha.Service
@behaviour Service
@impl Service
def new do
case Captcha.get() do
-
{:timeout}
->
- %{error:
dgettext("errors", "Captcha timeout")
}
+
:error
->
+ %{error:
:captcha_error
}
{:ok, answer_data, img_binary} ->
%{
{:ok, answer_data, img_binary} ->
%{
@@
-25,7
+24,7
@@
defmodule Pleroma.Captcha.Native do
@impl Service
def validate(_token, captcha, captcha) when not is_nil(captcha), do: :ok
@impl Service
def validate(_token, captcha, captcha) when not is_nil(captcha), do: :ok
- def validate(_token, _captcha, _answer), do: {:error,
dgettext("errors", "Invalid CAPTCHA")
}
+ def validate(_token, _captcha, _answer), do: {:error,
:invalid
}
defp token do
10
defp token do
10