import type { ConvexHttpClient } from "convex/browser";
import type { AuthContext } from "@/lib/auth/types";
import { requireAuthContext } from "@/lib/auth/authContext";
import { getConvexAuthedHttpClient } from "@/lib/convex/server";

export async function getAuthedConvexClient(): Promise<{ auth: AuthContext; client: ConvexHttpClient }> {
  const auth = await requireAuthContext();
  const client = await getConvexAuthedHttpClient();
  return { auth, client };
}
