Commit d16b6139 authored by Roger Braun's avatar Roger Braun

MastodonUI login: Show error message on error.

parent ad90da07
......@@ -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
......
<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>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment