timkmecl / chatgpt-vscode

VSCode extension that allows you to use ChatGPT or GPT4 inside the IDE
331 stars 81 forks source link

Add clearance token and userAgent #3

Closed mohammad-oghli closed 1 year ago

mohammad-oghli commented 1 year ago

As a temporary workaround to fix the authentication token error we should add clearanceToken and userAgent. I added them as comment in the code.

timkmecl commented 1 year ago

Hi, thank you for letting me know about this! I will update the repo to use the latest version of chatgpt-api that utilizes this in a few hours.

Do you think these two parameters should be a part of extension setting like sessionTokens is now or should there be a popup that opens when the extension is run/tokens expire (since these parameters will have to be updated more often)?

mohammad-oghli commented 1 year ago

Your welcome, Yes I think these two parameters should be a part of extension setting like sessionTokens. Check the updated issue on the chatgpt-api for the additional Cloudflare protections that OpenAI added it.

mohammad-oghli commented 1 year ago

Well done! I think the issue solved and the extension is working as expected I tested on my VS Code

check the chatGPT VS Code screenshot

timkmecl commented 1 year ago

Great, I am happy it works! I will now close this PR, but thanks again for bringing the issue to my attention and suggesting a solution:)