From 06aa3bb9aa76f1ee84ce71fa98bde5bbe25031f4 Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Fri, 13 Mar 2026 04:17:40 +0100 Subject: [PATCH] fix: preserve original invite origin during federation double-redirect --- packages/web/src/components/JoinPage.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/web/src/components/JoinPage.tsx b/packages/web/src/components/JoinPage.tsx index d08d8c45..1663f5c6 100644 --- a/packages/web/src/components/JoinPage.tsx +++ b/packages/web/src/components/JoinPage.tsx @@ -178,10 +178,11 @@ export function JoinPage() { const domain = otherDomain.trim(); if (!domain) return; - // Build the qualified invite code: code@thisHost - const thisHost = window.location.host; + // Build the qualified invite code: code@originHost + // If the invite is already qualified (arrived via redirect), preserve the original origin + const originHost = parsed?.origin ? new URL(parsed.origin).host : window.location.host; const code = parsed?.code || rawInviteCode || ''; - const qualifiedCode = `${code}@${thisHost}`; + const qualifiedCode = `${code}@${originHost}`; const targetUrl = `https://${domain}/join/${encodeURIComponent(qualifiedCode)}`; window.location.href = targetUrl; };