Merge pull request #3237 from 3mora2/main

Improve auth cookie detection in Copilot provider
This commit is contained in:
H Lohaus 2025-11-09 22:01:49 +01:00 committed by GitHub
commit 5bacb669b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -380,6 +380,8 @@ async def get_access_token_and_cookies(url: str, proxy: str = None, needs_auth:
cookies = {c.name: c.value for c in await page.send(nodriver.cdp.network.get_cookies([url]))} cookies = {c.name: c.value for c in await page.send(nodriver.cdp.network.get_cookies([url]))}
if not needs_auth and Copilot.anon_cookie_name in cookies: if not needs_auth and Copilot.anon_cookie_name in cookies:
break break
elif needs_auth and next(filter(lambda x: "auth0" in x, cookies), None):
break
stop_browser() stop_browser()
return access_token, useridentitytype, cookies return access_token, useridentitytype, cookies
finally: finally: