avoid double rendering when the response is already an error

This commit is contained in:
byte[] 2019-12-21 13:42:21 -05:00
parent 823834e5c1
commit d081f06422

View file

@ -74,14 +74,9 @@ defmodule PowLockout.Phoenix.ControllerCallbacks do
end
defp invalid_credentials(conn) do
{:ok, conn} =
Plug.clear_authenticated_user(conn)
{:ok, conn} = Plug.clear_authenticated_user(conn)
conn
|> Conn.assign(:changeset, Plug.change_user(conn, conn.params["user"]))
|> Controller.put_flash(:error, messages(conn).invalid_credentials(conn))
|> Controller.render("new.html")
|> Conn.halt()
end
@doc """