From 8af8f01fb88f3d867d4b1cb373d34c2879f6e249 Mon Sep 17 00:00:00 2001 From: atesta103 Date: Fri, 24 Jul 2026 14:53:16 +0200 Subject: [PATCH] fix(ticket): show the actual recovery domain instead of a hardcoded one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ticket's hint text hardcoded "Prénom + code sur waitlight.app" regardless of what recoverUrl actually pointed to — misleading on a Preview deployment (or any environment other than the one that string happened to name), and worse on a real, physical ticket someone might print or reference later. Derives the displayed host from recoverUrl itself via hostFromUrl(), so the text always matches whatever domain the QR code and printed link actually encode. Co-Authored-By: Claude Opus 4.8 --- components/composed/TicketDownloadCard.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/components/composed/TicketDownloadCard.tsx b/components/composed/TicketDownloadCard.tsx index 9334ddd..8422be7 100644 --- a/components/composed/TicketDownloadCard.tsx +++ b/components/composed/TicketDownloadCard.tsx @@ -26,6 +26,21 @@ type TicketDownloadCardProps = { const DEFAULT_BRAND_COLOR = "#6366f1" +/** + * Extracts just the host from the recovery URL (e.g. "waitlight.fr"), so the + * hint text always names whatever domain the QR code actually points to — + * previously this was a hardcoded string that stayed "waitlight.app" even + * when recoverUrl pointed somewhere else entirely (a Preview deployment, a + * different environment), which is misleading on a real, physical ticket. + */ +function hostFromUrl(url: string): string { + try { + return new URL(url).host + } catch { + return "" + } +} + /** * The visual captured to PNG when a customer downloads their ticket. Pure * presentation — no state, no network calls — so it renders identically @@ -124,7 +139,7 @@ const TicketDownloadCard = forwardRef( {recoveryCode} - Prénom + code sur waitlight.app + Prénom + code sur {hostFromUrl(recoverUrl)} {/* SVG, not Canvas: html-to-image serializes the DOM/SVG