logo

pleroma

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

fallback_controller.ex (989B)


  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.OAuth.FallbackController do
  5. use Pleroma.Web, :controller
  6. alias Pleroma.Web.OAuth.OAuthController
  7. def call(conn, {:register, :generic_error}) do
  8. conn
  9. |> put_status(:internal_server_error)
  10. |> put_flash(
  11. :error,
  12. dgettext("errors", "Unknown error, please check the details and try again.")
  13. )
  14. |> OAuthController.registration_details(conn.params)
  15. end
  16. def call(conn, {:register, _error}) do
  17. conn
  18. |> put_status(:unauthorized)
  19. |> put_flash(:error, dgettext("errors", "Invalid Username/Password"))
  20. |> OAuthController.registration_details(conn.params)
  21. end
  22. def call(conn, _error) do
  23. conn
  24. |> put_status(:unauthorized)
  25. |> put_flash(:error, dgettext("errors", "Invalid Username/Password"))
  26. |> OAuthController.authorize(conn.params)
  27. end
  28. end