fix: stay on light-meetings after auth, skip name input, join directly with auth cookies
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
8321a7d3c5
commit
7abd123404
2 changed files with 13 additions and 19 deletions
|
|
@ -131,11 +131,12 @@ export class JoinProcedure {
|
||||||
this._logger.info(`Starting lobby join flow... (authenticated: ${this._isAuthenticated})`);
|
this._logger.info(`Starting lobby join flow... (authenticated: ${this._isAuthenticated})`);
|
||||||
|
|
||||||
if (this._isAuthenticated) {
|
if (this._isAuthenticated) {
|
||||||
// Authenticated join: wait for the authenticated pre-join page.
|
// Authenticated join: Auth cookies are set but we're on the light-meetings
|
||||||
// Proof that we're on the RIGHT page: no name input field exists
|
// page (Teams blocks /v2/ for headless browsers). We skip entering a name
|
||||||
// (the anonymous page has input[placeholder="Type your name"]).
|
// and just click "Join now" directly. Teams will use the auth cookies to
|
||||||
// Retry up to 5 times, every 5 seconds.
|
// identify the user even on the light-meetings page.
|
||||||
await this._waitForAuthenticatedPreJoinPage();
|
this._logger.info('Authenticated join on light-meetings: skipping name, clicking Join now directly...');
|
||||||
|
await this._page.waitForTimeout(2000);
|
||||||
} else {
|
} else {
|
||||||
// Anonymous join: enter bot name in the name input field
|
// Anonymous join: enter bot name in the name input field
|
||||||
await this._enterBotName();
|
await this._enterBotName();
|
||||||
|
|
|
||||||
|
|
@ -216,23 +216,16 @@ export class BotOrchestrator {
|
||||||
if (authSuccess) {
|
if (authSuccess) {
|
||||||
this._logger.info('Authentication via "Sign in" link succeeded');
|
this._logger.info('Authentication via "Sign in" link succeeded');
|
||||||
|
|
||||||
// Auth cookies are now set. The current page is still on light-meetings
|
// Auth cookies are now set. Teams /v2/ blocks headless browsers,
|
||||||
// with anon=true — which keeps showing the anonymous experience regardless
|
// so we stay on the light-meetings page and join from here.
|
||||||
// of auth cookies. We need to start fresh: navigate to the ORIGINAL meeting
|
// The auth cookies will identify us to Teams even via light-meetings.
|
||||||
// URL (without anon=true). With auth cookies set, Teams will route to the
|
// We skip entering a name and just click "Join now" directly.
|
||||||
// authenticated experience (no name input, account name shown).
|
this._logger.info('Auth complete. Staying on light-meetings, will join with auth cookies...');
|
||||||
this._logger.info('Auth complete. Re-navigating to meeting URL with auth cookies...');
|
|
||||||
|
|
||||||
// Navigate to the clean meeting URL — Teams will go through launcher again
|
// Wait for the page to settle after the auth redirect chain
|
||||||
// but this time with auth cookies, so "Continue on this browser" should
|
|
||||||
// lead to the authenticated pre-join page.
|
|
||||||
await this._joinProcedure!.startMeetingLauncherFlow(this._meetingUrl);
|
|
||||||
|
|
||||||
// Wait for the page to settle after the new navigation
|
|
||||||
await this._page!.waitForTimeout(3000);
|
await this._page!.waitForTimeout(3000);
|
||||||
|
|
||||||
const settledUrl = this._page!.url();
|
const settledUrl = this._page!.url();
|
||||||
this._logger.info(`Post-auth re-navigation URL: ${settledUrl.substring(0, 100)}`);
|
this._logger.info(`Post-auth settled URL: ${settledUrl.substring(0, 100)}`);
|
||||||
} else {
|
} else {
|
||||||
this._logger.warn('Authentication via "Sign in" failed - continuing as anonymous');
|
this._logger.warn('Authentication via "Sign in" failed - continuing as anonymous');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue