We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54fcc74 commit c8a9873Copy full SHA for c8a9873
src/background/index.mjs
@@ -41,7 +41,16 @@ async function getChatGptAccessToken() {
41
if (userConfig.accessToken) {
42
return userConfig.accessToken
43
} else {
44
- const resp = await fetch('https://chat.openai.com/api/auth/session')
+ const cookie = (await Browser.cookies.getAll({ url: 'https://chat.openai.com/' }))
45
+ .map((cookie) => {
46
+ return `${cookie.name}=${cookie.value}`
47
+ })
48
+ .join('; ')
49
+ const resp = await fetch('https://chat.openai.com/api/auth/session', {
50
+ headers: {
51
+ Cookie: cookie,
52
+ },
53
54
if (resp.status === 403) {
55
throw new Error('CLOUDFLARE')
56
}
0 commit comments