mirror of
https://github.com/snobu/destreamer.git
synced 2026-02-07 23:49:43 +00:00
fix target during SharePoint login
This commit is contained in:
@@ -23,7 +23,7 @@ export async function doStreamLogin(url: string, tokenCache: TokenCache, usernam
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
// try-finally because we were leaving zombie processes if there was an error
|
// try-finally because we were leaving zombie processes if there was an error
|
||||||
try {
|
try {
|
||||||
const page: puppeteer.Page = (await browser.pages())[0];
|
const page: puppeteer.Page = (await browser.pages())[0];
|
||||||
|
|
||||||
@@ -94,7 +94,11 @@ export async function doStreamLogin(url: string, tokenCache: TokenCache, usernam
|
|||||||
export async function doShareLogin(url: string, username?: string): Promise<ShareSession> {
|
export async function doShareLogin(url: string, username?: string): Promise<ShareSession> {
|
||||||
logger.info('Launching headless Chrome to perform the OpenID Connect dance...');
|
logger.info('Launching headless Chrome to perform the OpenID Connect dance...');
|
||||||
|
|
||||||
const hostname = new URL(url).hostname;
|
const hostname = new URL(url).host;
|
||||||
|
logger.verbose(new URL(url).host);
|
||||||
|
logger.verbose(new URL(url).hostname);
|
||||||
|
|
||||||
|
|
||||||
const browser: puppeteer.Browser = await puppeteer.launch({
|
const browser: puppeteer.Browser = await puppeteer.launch({
|
||||||
executablePath: getPuppeteerChromiumPath(),
|
executablePath: getPuppeteerChromiumPath(),
|
||||||
headless: false,
|
headless: false,
|
||||||
@@ -135,7 +139,7 @@ export async function doShareLogin(url: string, username?: string): Promise<Shar
|
|||||||
|
|
||||||
logger.info('Waiting for target!');
|
logger.info('Waiting for target!');
|
||||||
|
|
||||||
await browser.waitForTarget((target: puppeteer.Target) => target.url().includes(hostname), { timeout: 150000 });
|
await browser.waitForTarget((target: puppeteer.Target) => target.url().startsWith(`https://${hostname}`), { timeout: 150000 });
|
||||||
logger.info('We are logged in.');
|
logger.info('We are logged in.');
|
||||||
|
|
||||||
let session: ShareSession | null = null;
|
let session: ShareSession | null = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user