Remove vapidPublicKey from Nodeinfo
[akkoma] / test / support / captcha_mock.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Captcha.Mock do
6 alias Pleroma.Captcha.Service
7 @behaviour Service
8
9 @impl Service
10 def new,
11 do: %{
12 type: :mock,
13 token: "afa1815e14e29355e6c8f6b143a39fa2",
14 answer_data: "63615261b77f5354fb8c4e4986477555",
15 url: "https://example.org/captcha.png"
16 }
17
18 @impl Service
19 def validate(_token, captcha, captcha) when not is_nil(captcha), do: :ok
20
21 def validate(_token, captcha, answer),
22 do: {:error, "Invalid CAPTCHA captcha: #{inspect(captcha)} ; answer: #{inspect(answer)}"}
23 end