MastodonUI login: Show error message on error.

This commit is contained in:
Roger Braun 2017-11-23 12:06:14 +01:00
parent ad90da07f5
commit d16b613929
2 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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>