返回提交历史
Modified
g4f/Provider/Copilot.py
+2
-0
XFEstudio/gpt4free
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.
db2e0666
代码差异
1 个文件
+2
-0
@@ -380,6 +380,8 @@ async def get_access_token_and_cookies(url: str, proxy: str = None, needs_auth:
380
380
cookies = {c.name: c.value for c in await page.send(nodriver.cdp.network.get_cookies([url]))}
381
381
if not needs_auth and Copilot.anon_cookie_name in cookies:
382
382
break
383
elif needs_auth and next(filter(lambda x: "auth0" in x, cookies), None):
384
break
383
385
stop_browser()
384
386
return access_token, useridentitytype, cookies
385
387
finally: