mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 16:40:29 +00:00
MastodonUI login: Show error message on error.
This commit is contained in:
parent
ad90da07f5
commit
d16b613929
2 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue