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 @@ def index(%{assigns: %{user: user}} = conn, _params) 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 @@ def login_post(conn, %{"authorization" => %{ "name" => name, "password" => passw 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 @@