fix: after auth login, navigate back to meeting URL (Microsoft redirects to M365 instead of meeting)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
121c70e60a
commit
d8d1ffec17
1 changed files with 21 additions and 5 deletions
|
|
@ -213,19 +213,35 @@ export class BotOrchestrator {
|
|||
|
||||
if (authSuccess) {
|
||||
this._logger.info('Authentication via "Sign in" link succeeded');
|
||||
// After auth, Teams redirects back to the authenticated pre-join page
|
||||
// within Teams v2 (/v2/) -- wait for it to load
|
||||
await this._page!.waitForTimeout(5000);
|
||||
await this._page!.waitForTimeout(3000);
|
||||
|
||||
const postAuthUrl = this._page!.url();
|
||||
this._logger.info(`Post-auth URL: ${postAuthUrl.substring(0, 80)}`);
|
||||
this._logger.info(`Post-auth URL: ${postAuthUrl.substring(0, 100)}`);
|
||||
|
||||
// After login, Microsoft may redirect to M365/Office instead of back to the meeting.
|
||||
// We need to navigate back to the meeting URL -- now with the auth session active.
|
||||
// This time, Teams should recognize the auth and show the authenticated pre-join page.
|
||||
if (!postAuthUrl.includes('teams.microsoft.com/v2') || !postAuthUrl.includes('meet')) {
|
||||
this._logger.info('Not on Teams meeting page after auth - navigating back to meeting URL...');
|
||||
await this._page!.goto(this._meetingUrl, {
|
||||
waitUntil: 'domcontentloaded',
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
// Handle launcher dialog if it appears again
|
||||
await this._joinProcedure!.handleLauncherIfPresent();
|
||||
await this._page!.waitForTimeout(5000);
|
||||
|
||||
const meetingPageUrl = this._page!.url();
|
||||
this._logger.info(`After re-navigation to meeting: ${meetingPageUrl.substring(0, 100)}`);
|
||||
}
|
||||
|
||||
// Verify we're on the authenticated pre-join page
|
||||
const pageText = await this._page!.evaluate(() => document.body?.innerText?.substring(0, 500) || '');
|
||||
if (pageText.includes('Join now')) {
|
||||
this._logger.info('On authenticated pre-join page with "Join now" button');
|
||||
} else {
|
||||
this._logger.warn(`Post-auth page content: ${pageText.substring(0, 200)}`);
|
||||
this._logger.warn(`Post-auth page content: ${pageText.substring(0, 300)}`);
|
||||
}
|
||||
} else {
|
||||
this._logger.warn('Authentication via "Sign in" failed - continuing as anonymous');
|
||||
|
|
|
|||
Loading…
Reference in a new issue