diff options
| -rw-r--r-- | lib/pleroma/web/mastodon_api/mastodon_api_controller.ex | 6 | ||||
| -rw-r--r-- | lib/pleroma/web/templates/mastodon_api/mastodon/login.html.eex | 3 | 
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex index fc7f21096..82887966c 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -559,7 +559,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do    def login(conn, _) do      conn -    |> render(MastodonView, "login.html") +    |> render(MastodonView, "login.html", %{error: false})    end    defp get_or_make_app() do @@ -581,6 +581,10 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do        conn        |> put_session(:oauth_token, token.token)        |> redirect(to: "/web/getting-started") +    else +      _e -> +        conn +        |> render(MastodonView, "login.html", %{error: "Wrong username or password"})      end    end diff --git a/lib/pleroma/web/templates/mastodon_api/mastodon/login.html.eex b/lib/pleroma/web/templates/mastodon_api/mastodon/login.html.eex index 89d97561b..2ef67b901 100644 --- a/lib/pleroma/web/templates/mastodon_api/mastodon/login.html.eex +++ b/lib/pleroma/web/templates/mastodon_api/mastodon/login.html.eex @@ -1,4 +1,7 @@  <h2>Login in to Mastodon Frontend</h2> +<%= if @error do %> +  <h2><%= @error %></h2> +<% end %>  <%= form_for @conn, mastodon_api_path(@conn, :login), [as: "authorization"], fn f -> %>  <%= text_input f, :name, placeholder: "Username" %>  <br>  | 
