"use client";

import { signOut } from "next-auth/react";
import { useSearchParams } from "next/navigation";
import { useEffect } from "react";

const LogoutPage = () => {
  const params = useSearchParams();
  const callbackUrl = params.get("callbackUrl");
  useEffect(() => {
    signOut({ redirect: true, callbackUrl: callbackUrl || "/" });
  });

  return null;
};

export default LogoutPage;
