diff --git a/lib/chess/auth/error_handler.ex b/lib/chess/auth/error_handler.ex index eb4ccde..c68584f 100644 --- a/lib/chess/auth/error_handler.ex +++ b/lib/chess/auth/error_handler.ex @@ -1,12 +1,14 @@ defmodule Chess.Auth.ErrorHandler do @moduledoc false + use ChessWeb, :controller + import Plug.Conn def auth_error(conn, {_type, _reason}, _opts) do conn - |> Phoenix.Controller.put_flash(:info, "You must be logged in") - |> Phoenix.Controller.redirect(to: "/") + |> put_flash(:info, "You must be logged in") + |> redirect(to: "/") |> halt() end end