projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix aliases sorting
[akkoma]
/
lib
/
pleroma
/
captcha.ex
diff --git
a/lib/pleroma/captcha.ex
b/lib/pleroma/captcha.ex
index 6ab754b6f1dc333930471555b5c09c5e593144a0..bad7b3a66e3e65db3b529943990e4e3865825826 100644
(file)
--- a/
lib/pleroma/captcha.ex
+++ b/
lib/pleroma/captcha.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-202
0
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-202
1
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Captcha do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Captcha do
@@
-7,6
+7,8
@@
defmodule Pleroma.Captcha do
alias Plug.Crypto.KeyGenerator
alias Plug.Crypto.MessageEncryptor
alias Plug.Crypto.KeyGenerator
alias Plug.Crypto.MessageEncryptor
+ @cachex Pleroma.Config.get([:cachex, :provider], Cachex)
+
@doc """
Ask the configured captcha service for a new captcha
"""
@doc """
Ask the configured captcha service for a new captcha
"""
@@
-86,7
+88,7
@@
defmodule Pleroma.Captcha do
end
defp validate_usage(token) do
end
defp validate_usage(token) do
- if is_nil(
C
achex.get!(:used_captcha_cache, token)) do
+ if is_nil(
@c
achex.get!(:used_captcha_cache, token)) do
:ok
else
{:error, :already_used}
:ok
else
{:error, :already_used}
@@
-95,7
+97,7
@@
defmodule Pleroma.Captcha do
defp mark_captcha_as_used(token) do
ttl = seconds_valid() |> :timer.seconds()
defp mark_captcha_as_used(token) do
ttl = seconds_valid() |> :timer.seconds()
-
C
achex.put(:used_captcha_cache, token, true, ttl: ttl)
+
@c
achex.put(:used_captcha_cache, token, true, ttl: ttl)
end
defp method, do: Pleroma.Config.get!([__MODULE__, :method])
end
defp method, do: Pleroma.Config.get!([__MODULE__, :method])