import { cookies } from "next/headers";

export async function getUser() {
  const cookieStore = await cookies();
  const isAuthenticated =
    cookieStore.get("refresh_token") && cookieStore.get("userInfo");
  if (!isAuthenticated) return null;
  return cookieStore.get("userInfo");
}
