mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 21:47: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
|
||||
|
||||
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 """
|
||||
|
|
Loading…
Reference in a new issue