-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Session token no longer working. #1
Comments
Hmm haven't run into this issue personally Did you log out of https://chat.openai.com/ because that may have invalidated the session token, also I would double check if SESSION_TOKEN variable is still set I'm not certain if you changed terminals for instance or how much time has passed from the time it worked to not working. You could add the session token as a .env file in the future so it loads everytime the app loads. |
I asked ChatGPT why I am getting the error, Why am I getting this error: Error: ChatGPT failed to refresh auth token. ChatGPT suggested: Check the expiration date of the authentication token and make sure it is still valid. If the token has expired, you will need to generate a new one and use it instead. I asked ChatGPT to check if the token was expired: The current date and time is Sunday, December 11, 2023, 3:56 Central time zone. Now can you give me a result? import datetime
import pytz
# Define the expiration date and time in UTC
expiration_date = datetime.datetime(2023, 1, 10, 21, 49, 9, 763000, tzinfo=pytz.utc)
# Get the current date and time in the specified time zone
timezone = pytz.timezone('America/Chicago')
now = datetime.datetime.now(timezone)
# Calculate the duration of the session token in seconds
duration = (expiration_date - now).total_seconds()
# Print the duration of the session token
print(duration) This code calculates the difference between the expiration date and the current date and time in the specified time zone (Central time in this case), and then prints the result. The result will be the duration of the session token in seconds. In this specific case, the duration of the session token would be approximately 104444000 seconds, which is approximately 1206.5 hours or 50.3 days. I hope this helps! Let me know if you have any other questions. ChatGPT suggested: If the connectivity to the authentication server is not the issue, you can try clearing the authentication cache and then re-authenticating with the API. This can sometimes fix issues with invalid or expired authentication tokens. |
It's strange because my token allows me to use the ChatGPT on their website but when I try to used the ai-chatbot in terminal, nope! |
I think it's an issue that just started with a recent update actually. transitive-bullshit/agentic#96 |
Oh cool! An update no worries! Yes I was wanting to do an .env file also, but I am getting a typescript error about process needs Node.js, would I just set up a TypeScript file? Or do a full Next app? To get node.js to use process.env? Thanks for the help I still have so much to learn! |
No Worries, hopefully this will get resolved soon! |
IMPORTANT UPDATE: The SESSION_TOKEN solution no longer works (since the time I recorded my video). But, you can modify this code to use your username and password as a login as of the time I'm writing this message, For more details on how to do that along with the latest authentication strategies can be located here: https://github.com/transitive-bullshit/chatgpt-api Anyone who wishes to update this repository by sending over a pull request to keep it up to date is welcomed and appreciated |
Awesome, thank you:
|
I export SESSION_TOKEN="my-token-here", but it stopped accepting the token, looks like a fetch error.
The text was updated successfully, but these errors were encountered: