fix: preserve original invite origin during federation double-redirect
This commit is contained in:
@@ -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;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user