logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

wrapper_authenticator.ex (1241B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Web.Auth.WrapperAuthenticator do
  5. @behaviour Pleroma.Web.Auth.Authenticator
  6. defp implementation do
  7. Pleroma.Config.get(
  8. Pleroma.Web.Auth.Authenticator,
  9. Pleroma.Web.Auth.PleromaAuthenticator
  10. )
  11. end
  12. @impl true
  13. def get_user(plug), do: implementation().get_user(plug)
  14. @impl true
  15. def create_from_registration(plug, registration),
  16. do: implementation().create_from_registration(plug, registration)
  17. @impl true
  18. def get_registration(plug), do: implementation().get_registration(plug)
  19. @impl true
  20. def handle_error(plug, error),
  21. do: implementation().handle_error(plug, error)
  22. @impl true
  23. def auth_template do
  24. # Note: `config :pleroma, :auth_template, "..."` support is deprecated
  25. implementation().auth_template() ||
  26. Pleroma.Config.get([:auth, :auth_template], Pleroma.Config.get(:auth_template)) ||
  27. "show.html"
  28. end
  29. @impl true
  30. def oauth_consumer_template do
  31. implementation().oauth_consumer_template() ||
  32. Pleroma.Config.get([:auth, :oauth_consumer_template], "consumer.html")
  33. end
  34. end