<script>
    document.body.addEventListener("htmx:configRequest", (event) => {
      const token = document.querySelector("[name=csrfmiddlewaretoken]").value;
      event.detail.headers["X-CSRFToken"] = token;
    });
</script>
