Skip to content

feature: Embed Invite#1908

Open
BadPirate wants to merge 6 commits into
alextselegidis:developfrom
kaperkunde:feature/543-embed-booking-widget
Open

feature: Embed Invite#1908
BadPirate wants to merge 6 commits into
alextselegidis:developfrom
kaperkunde:feature/543-embed-booking-widget

Conversation

@BadPirate

@BadPirate BadPirate commented Jun 8, 2026

Copy link
Copy Markdown

Summary

Resolves #543 - Providing the ability to embed calendar services directly into external websites

  • Adds iframe embedding for the public booking flow so calendars can be placed on external websites (Calendly-style widget with auto-resize via postMessage).
  • Introduces EMBED_ALLOWED_ORIGINS configuration and switches booking framing from blanket X-Frame-Options: SAMEORIGIN to CSP frame-ancestors for allowed origins on booking-related routes.
  • Adds stateless HMAC CSRF tokens plus SameSite=None / partitioned cookie support so booking submissions work inside third-party iframes where cookies are blocked.
  • Adds a Booking Embed section on the Services admin page with copyable HTML, live preview, and translations across all 42 language files.
  • Consolidates security headers from routes.php into the existing security_headers hook.

Testing

  • Validated CSRF in production with multiple sites, as well as negative case (hosting on a site that isn't listed in EMBED_ALLOWED_ORIGINS)
  • New unit tests for helpers
  • Verified unit tests pass in CI (after fix: Broken CI needs config #1906 and related PR are applied)

Additional testing post merge

On my own host, launched with the latest develop branch (including some of the initial embed changes like language embedding from @alextselegidis) and deployed:

https://dev.gaaf.kaperkun.de/embed-test/ -- This host is in the EMBED_ALLOWED_ORIGINS (works)
https://bad.dev.gaaf.kaperkun.de/embed-test/ -- This host is not in EMBED_ALLOWED_ORIGINS (fails)

Screenshots

Embedding Guide Embedded Result
Screenshot 2026-06-08 at 9 33 49 PM Screenshot 2026-06-08 at 11 06 46 PM

BadPirate added 2 commits June 8, 2026 23:13
Feature ask, allow embedding of calendar on other websites through
iframe.

Changes to service edit page to show the HTML that would allow for
embedding as well as a preview for each service, as well as tokens
to allow cross site usage. Set EMBED_ALLOWED_ORIGINS ENV to allow
for embedding into other sites.
@BadPirate

Copy link
Copy Markdown
Author

@alextselegidis -- So....... In the process of making this merge, I just noticed that your develop branch already has something almost identical to what I just built.

I'm going to leave this here (as it's 11:30p in Netherlands) and de-conflict the efforts when I'm fresh.

@BadPirate

Copy link
Copy Markdown
Author

Okay, since I'm tired, I had cursor take a look at the merge mess, and it's not as bad as I thought. Here's what the machines think:

cursor_booking_widget_embedding_efforts.md

From my diff:

  • Keep the stateless HMAC tokens / more secure approach for CSRF, preview and embed helper, tests, etc from my diff
  • Keep the valid localization fixes from yours

BadPirate added 2 commits June 9, 2026 08:45
Deleted the ALLOWALL helper from security_helper.php
Removed all 10 per-controller calls
apply_frame_embedding_headers() - If embedded
updated changelog
@BadPirate

Copy link
Copy Markdown
Author

Okay, resolved merge issues, combined functionality, and verified on my test server https://dev.gaaf.kaperkun.de/embed-test/

BadPirate and others added 2 commits June 11, 2026 13:20
Changing language in a cross-origin iframe stored the preference in
session, but third-party cookies are blocked so the reload fell back to
the original language query param. Navigate with an updated language
param instead when the booking page is embedded.

Co-authored-by: Cursor <cursoragent@cursor.com>
Traditional CAPTCHA stores its phrase in the session, but embed mode only
upgraded CSRF cookies to SameSite=None while session cookies stayed Lax
and were blocked in third-party iframes. Issue cross-site session
cookies for public booking flow routes including captcha.

Co-authored-by: Cursor <cursoragent@cursor.com>

fixup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant