From d081f06422fb56c6d98a8d207cbd2b66883926ab Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sat, 21 Dec 2019 13:42:21 -0500 Subject: [PATCH] avoid double rendering when the response is already an error --- .../phoenix/controllers/controller_callbacks.ex | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/pow_lockout/phoenix/controllers/controller_callbacks.ex b/lib/pow_lockout/phoenix/controllers/controller_callbacks.ex index a410245a..9baa2a0b 100644 --- a/lib/pow_lockout/phoenix/controllers/controller_callbacks.ex +++ b/lib/pow_lockout/phoenix/controllers/controller_callbacks.ex @@ -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 """