1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.OAuth.FallbackController do
6 use Pleroma.Web, :controller
7 alias Pleroma.Web.OAuth.OAuthController
9 def call(conn, {:register, :generic_error}) do
11 |> put_status(:internal_server_error)
14 dgettext("errors", "Unknown error, please check the details and try again.")
16 |> OAuthController.registration_details(conn.params)
19 def call(conn, {:register, _error}) do
21 |> put_status(:unauthorized)
22 |> put_flash(:error, dgettext("errors", "Invalid Username/Password"))
23 |> OAuthController.registration_details(conn.params)
26 def call(conn, _error) do
28 |> put_status(:unauthorized)
29 |> put_flash(:error, dgettext("errors", "Invalid Username/Password"))
30 |> OAuthController.authorize(conn.params)