diff --git a/src/components/BookingSection.tsx b/src/components/BookingSection.tsx index dbcf333..f1e9c8a 100644 --- a/src/components/BookingSection.tsx +++ b/src/components/BookingSection.tsx @@ -2,7 +2,7 @@ import { useState, useEffect, useRef } from "react"; import { motion } from "framer-motion"; import { z } from "zod"; import { Button } from "@/components/ui/button"; -import { WEBHOOK_URL } from "@/data/event-data"; +import { WEBHOOK_URL, WEBHOOK_SECRET } from "@/data/event-data"; import { CheckCircle, Loader2, AlertCircle, Search } from "lucide-react"; /** @@ -135,6 +135,10 @@ const BookingSection = () => { console.log("[Booking] Sending to:", WEBHOOK_URL); const res = await fetch(WEBHOOK_URL, { method: "POST", + headers: { + "Content-Type": "application/json", + "X-Webhook-Secret": WEBHOOK_SECRET, + }, body: JSON.stringify(result.data), }); console.log("[Booking] Response status:", res.status); diff --git a/src/data/event-data.ts b/src/data/event-data.ts index 299a825..347079b 100644 --- a/src/data/event-data.ts +++ b/src/data/event-data.ts @@ -57,6 +57,13 @@ export const EVENT_INFO = { * } */ export const WEBHOOK_URL = "https://n8n.hacecalor.net/webhook/event-reservation"; +/** + * CLAVE DE AUTENTICACIÓN: + * + * Si activas "Header Auth" en n8n, asegúrate de que el nombre del header + * sea "X-Webhook-Secret" y que este valor coincida con el que pongas allí. + */ +export const WEBHOOK_SECRET = "oWkS4cAgj0LVgIbnO3cGKTePPLnRAIAa5NTvXahx5z0="; // ---- SOBRE EL EVENTO ---- export const ABOUT_EVENT = { diff --git a/ticket-template.html b/ticket-template.html new file mode 100644 index 0000000..62ac0b2 --- /dev/null +++ b/ticket-template.html @@ -0,0 +1,149 @@ + + +
+ + +