import { getUser } from "@/auth";
import { getUserInfo } from "@/ldap";
import AboutMe from "./AboutMe";
import { redirect } from "next/navigation";

export default async function Page() {
  const user = await getUser();
  if (!user) redirect("/login");

  const info = await getUserInfo(user);
  if (info === null) redirect("/register");

  return <AboutMe info={info} />;
}
