       |> halt()
     end
   end
+
+
+  defp forbid_authenticated_users(conn, _opts) do
+    if conn.assigns.current_user do
+      conn
+      |> redirect(to: "/")
+      |> halt()
+    else
+      conn
+    end
+  end
 end

defmodule LeatherWeb.UserController do
  use LeatherWeb, :controller
  # plug :authenticate when action in [:index]
  alias Leather.Repo
  alias Leather.User


  end


  defp require_authentication(conn, _opts) do
    if conn.assigns.current_user do
      conn
    else
