import { useNavigate } from "react-router-dom";
import useAuth from "./auth";


const useLogout = () => {
  const { setToken } = useAuth();
  const navigate = useNavigate();

  return () => {
    setToken(null);
    navigate("/login");
  };
}

export default useLogout;
