From 5deac2ab4012523fdb6661e1273affff18a4a1ff Mon Sep 17 00:00:00 2001 From: atesta103 Date: Fri, 24 Jul 2026 15:10:27 +0200 Subject: [PATCH] fix(ticket): show the recovery page's path, not just its bare domain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "waitlight.fr" alone doesn't say which merchant's recovery page to look for — a customer without the QR code has nowhere to go from a bare domain. Now shows host + pathname (e.g. "waitlight.fr/testa-crousty/retrouver"), dropping only the query string, which carries the name + code already shown separately in large text just above. Co-Authored-By: Claude Opus 4.8 --- components/composed/TicketDownloadCard.tsx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/components/composed/TicketDownloadCard.tsx b/components/composed/TicketDownloadCard.tsx index 8422be7..c05b10e 100644 --- a/components/composed/TicketDownloadCard.tsx +++ b/components/composed/TicketDownloadCard.tsx @@ -27,15 +27,19 @@ 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. + * Extracts the host + path from the recovery URL (e.g. + * "waitlight.fr/testa-crousty/retrouver") — enough to actually find the + * right page by hand, unlike the bare domain alone, which doesn't say which + * merchant's recovery page to look for. Drops the query string: it carries + * the name + code, already shown separately in large text just above, so + * repeating them here would only add clutter, not new information. + * Previously this was a hardcoded "waitlight.app" that stayed wrong on any + * environment other than the one that string happened to name. */ -function hostFromUrl(url: string): string { +function hostAndPathFromUrl(url: string): string { try { - return new URL(url).host + const { host, pathname } = new URL(url) + return `${host}${pathname}` } catch { return "" } @@ -139,7 +143,7 @@ const TicketDownloadCard = forwardRef( {recoveryCode} - Prénom + code sur {hostFromUrl(recoverUrl)} + Prénom + code sur {hostAndPathFromUrl(recoverUrl)} {/* SVG, not Canvas: html-to-image serializes the DOM/SVG