fix: preserve original invite origin during federation double-redirect

This commit is contained in:
Jannis Braun
2026-03-13 04:17:40 +01:00
parent 759f4c11ab
commit 06aa3bb9aa
+4 -3
View File
@@ -178,10 +178,11 @@ export function JoinPage() {
const domain = otherDomain.trim(); const domain = otherDomain.trim();
if (!domain) return; if (!domain) return;
// Build the qualified invite code: code@thisHost // Build the qualified invite code: code@originHost
const thisHost = window.location.host; // 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 code = parsed?.code || rawInviteCode || '';
const qualifiedCode = `${code}@${thisHost}`; const qualifiedCode = `${code}@${originHost}`;
const targetUrl = `https://${domain}/join/${encodeURIComponent(qualifiedCode)}`; const targetUrl = `https://${domain}/join/${encodeURIComponent(qualifiedCode)}`;
window.location.href = targetUrl; window.location.href = targetUrl;
}; };