mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-24 04:27:59 +01:00
avoid double rendering when the response is already an error
This commit is contained in:
parent
823834e5c1
commit
d081f06422
1 changed files with 1 additions and 6 deletions
|
@ -74,14 +74,9 @@ defmodule PowLockout.Phoenix.ControllerCallbacks do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp invalid_credentials(conn) do
|
defp invalid_credentials(conn) do
|
||||||
{:ok, conn} =
|
{:ok, conn} = Plug.clear_authenticated_user(conn)
|
||||||
Plug.clear_authenticated_user(conn)
|
|
||||||
|
|
||||||
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
|
end
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
|
|
Loading…
Reference in a new issue