import ContentLogin from "@/components/register/ContentLogin";
import { defineAbilitiesFor } from "@/lib/ability";
import { getUser } from "@/lib/auth";
import { redirect } from "next/navigation";

export const metadata = {
    robots: { index: false, follow: false },
};

async function LogIn() {
  const user = await getUser();
  const ability = defineAbilitiesFor(user);

  if (!ability.can("access", "Login")) {
    return redirect("/");
  }

  return <ContentLogin />;
}

export default LogIn;
