defmodule ToweropsWeb.PageController do
  @moduledoc false

  use ToweropsWeb, :controller

  def home(conn, _params) do
    # If user is authenticated, redirect to organization list
    if conn.assigns.current_scope && conn.assigns.current_scope.user do
      redirect(conn, to: ~p"/orgs")
    else
      render(conn, :home, layout: false)
    end
  end
end
