chore: CSRF protect cancel functionality (#23439)

* add csrf endpoint

* Update booking-pages.e2e.ts

* Update zod-utils.ts

* fix type error
This commit is contained in:
Anik Dhabal Babu authored and GitHub committed 2025-09-01 23:18:50 +00:00
1 parent 2e9aa01771
commit f6f36750ec
5 files changed
+40 -2

No files matched your search

+3
View File
@@ -656,9 +656,12 @@ test.describe("Event type with disabled cancellation and rescheduling", () => {
});
test("Should prevent cancellation and show an error message", async ({ page }) => {
const csrfTokenResponse = await page.request.get("/api/csrf");
const { csrfToken } = await csrfTokenResponse.json();
const response = await page.request.post("/api/cancel", {
data: {
uid: bookingId,
csrfToken,
},
headers: {
"Content-Type": "application/json",