fix: strip anon=true from embedded redirect URL for authenticated joins, increase bot timeout to 60s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
79027f190b
commit
1db83a805e
1 changed files with 15 additions and 1 deletions
|
|
@ -72,7 +72,18 @@ export async function resolveLaunchUrl(meetingUrl: string, isAuthenticated: bool
|
|||
|
||||
try {
|
||||
const response = await fetch(trimmed, { redirect: 'follow' });
|
||||
const resolvedUrl = new URL(response.url);
|
||||
let resolvedUrlStr = response.url;
|
||||
|
||||
// For authenticated joins: strip anon=true from everywhere in the URL
|
||||
// Teams redirects embed anon=true in the inner url= parameter (URL-encoded)
|
||||
if (isAuthenticated) {
|
||||
resolvedUrlStr = resolvedUrlStr
|
||||
.replace(/[&?]anon=true/gi, '')
|
||||
.replace(/%26anon%3Dtrue/gi, '')
|
||||
.replace(/%26anon%3Dfalse/gi, '');
|
||||
}
|
||||
|
||||
const resolvedUrl = new URL(resolvedUrlStr);
|
||||
|
||||
// Add params to suppress the native app launcher dialog
|
||||
resolvedUrl.searchParams.set('msLaunch', 'false');
|
||||
|
|
@ -84,6 +95,9 @@ export async function resolveLaunchUrl(meetingUrl: string, isAuthenticated: bool
|
|||
// Only add anon=true for anonymous joins
|
||||
if (!isAuthenticated) {
|
||||
resolvedUrl.searchParams.set('anon', 'true');
|
||||
} else {
|
||||
// Ensure anon is removed from outer params too
|
||||
resolvedUrl.searchParams.delete('anon');
|
||||
}
|
||||
|
||||
return resolvedUrl.toString();
|
||||
|
|
|
|||
Loading…
Reference in a new issue