defmodule ToweropsWeb.AdminController do
  @moduledoc """
  Controller for admin operations including user impersonation.
  """
  use ToweropsWeb, :controller

  alias ToweropsWeb.UserAuth

  @doc """
  Start impersonating a user.
  """
  def start_impersonate(conn, %{"user_id" => user_id}) do
    UserAuth.start_impersonation(conn, user_id)
  end

  @doc """
  Stop impersonating and return to superuser.
  """
  def stop_impersonate(conn, _params) do
    UserAuth.stop_impersonation(conn)
  end
end
