mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-05 18:20:35 -08:00
Improve auth cookie detection in Copilot provider
Adds a check for 'auth0' in cookies when authentication is required, ensuring the loop breaks appropriately once the relevant cookie is present.
This commit is contained in:
parent
4d98885ec0
commit
db2e066657
1 changed files with 2 additions and 0 deletions
|
|
@ -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]))}
|
||||
if not needs_auth and Copilot.anon_cookie_name in cookies:
|
||||
break
|
||||
elif needs_auth and next(filter(lambda x: "auth0" in x, cookies), None):
|
||||
break
|
||||
stop_browser()
|
||||
return access_token, useridentitytype, cookies
|
||||
finally:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue