From 96e8e497680e5d0cb2929a6e4b892d8dde858136 Mon Sep 17 00:00:00 2001 From: Musiker15 Date: Wed, 15 Jul 2026 08:21:23 +0200 Subject: [PATCH] fix(share): use the guild's verified custom domain for form links The per-form Share panel (link, QR code and embed snippet) always built the URL from the primary domain via appBaseUrl(), so a guild with a verified custom domain still shared the default forms.msk-scripts.de link. The forms page now resolves the public base to the guild's custom domain when customDomainVerifiedAt is set, and falls back to the primary domain otherwise. Live forms are served on the custom domain, so the shared link resolves correctly. --- apps/web/src/app/dashboard/[guildId]/forms/page.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/web/src/app/dashboard/[guildId]/forms/page.tsx b/apps/web/src/app/dashboard/[guildId]/forms/page.tsx index 0414eb4..5a20b67 100644 --- a/apps/web/src/app/dashboard/[guildId]/forms/page.tsx +++ b/apps/web/src/app/dashboard/[guildId]/forms/page.tsx @@ -45,7 +45,16 @@ export default async function GuildFormsPage({ // Whether the viewer may fully manage a given form (guild manager or a per-form // manage grant). Drives the per-form edit/preview/delete/export-definition buttons. const manages = (formId: string) => manageScope.all || manageScope.formIds.includes(formId); - const base = appBaseUrl(); + // Public form links (share link, QR, embed) point at the guild's verified + // custom domain when it has one, falling back to the primary domain otherwise. + const guildDomain = await prisma.guild.findUnique({ + where: { id: guildId }, + select: { customDomain: true, customDomainVerifiedAt: true }, + }); + const base = + guildDomain?.customDomain && guildDomain.customDomainVerifiedAt + ? `https://${guildDomain.customDomain}` + : appBaseUrl(); const dict = await getDict(); const t = dict.dashboard; const atFormLimit = !plan.isPro && forms.length >= FREE_FORM_LIMIT;