RomanHotsiy/commitgpt

Doesn't work after new OpenAI Cloudflare protections

Galz648 opened this issue ยท 14 comments

Description

Using this cli tool for the first time, posting the session token doesn't work.

  • I believe there should be a feature to set it as a local variable as it is easier to debug.

Steps to Reproduce

  • use the tool for the first time (maybe try to delete the existing token if you already used it)
  • copy the token from the browser
  • paste it into the terminal window

Expected Behavior

expected the access token to be accepted

Actual Behavior

I get a "invalid token" message.

Environment

Darwin 21.6.0

gaui commented

Same here. I get:

Invalid token. Please try again.

Duplicate of #21

I closed #21 because this one is linked from the readme.

I managed to workaround the issue by using chatgpt lib. It opens a browser window so you can authenticate as usual. And then proceeds to send the diff to get the commit message suggestions. It's a poor man's workaround, as you have to login every time you run the command with the browser. Buut, it's something

Check it out here:
https://github.com/davidlj95/commitgpt/tree/use-chatgpt-lib-with-puppeteer-to-bypass-cloudflare-restrictions

A win is there though: no need to copy / paste from the DevTools, as chatgpt lib grabs that info automagically. We just need to enter our email and pwd. So the process can be automated a bit more and we don't have to fill that in the browser each time.

Thanks for suggestion @davidlj95.

I believe it won't work anymore but I have plan to look into what can be done on the weekend.

https://github.com/transitive-bullshit/chatgpt-api

Update February 1, 2023
This package no longer requires any browser hacks โ€“ it is now using the official OpenAI completions API with a leaked model that ChatGPT uses under the hood. ๐Ÿ”ฅ

New paid ChatGPT API released by @openai. Maybe switch to that instead of any "hacks" or unofficial sources.

image
Something is wrong: Invalid token. Please try again.

I am also experiencing the same issue Invalid token. Please try again.. Has anyone fixed their issue?

Same (with GPT paid account) :(

hadees commented

can't it just us the official api now?

@RomanHotsiy Fix this please

Screenshot 2023-04-11 at 16 15 12

Fixed in 2.0.0 by #27