1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Captcha.Mock do
6 alias Pleroma.Captcha.Service
9 @solution "63615261b77f5354fb8c4e4986477555"
11 def solution, do: @solution
17 token: "afa1815e14e29355e6c8f6b143a39fa2",
18 answer_data: @solution,
19 url: "https://example.org/captcha.png",
24 def validate(_token, captcha, captcha) when not is_nil(captcha), do: :ok
26 def validate(_token, captcha, answer),
27 do: {:error, "Invalid CAPTCHA captcha: #{inspect(captcha)} ; answer: #{inspect(answer)}"}