Skip to content

Authentication should show login again if token expired or other token error #5678

Closed

Description

@matssk

What version of Codex is running?

0.49

What subscription do you have?

Pro

Which model were you using?

No response

What platform is your computer?

No response

What issue are you seeing?

It's not working.

Every requests results in the error: exceeded retry limit, last status: 401 Unauthorized, request id: 99438b5929d256ae-OSL

What steps can reproduce the bug?

Try to do anything

What is the expected behavior?

Something should work

Additional information

No response

Activity

  1. added
    bug
    on Oct 25, 2025
  2. matssk commented on Oct 25, 2025

    @matssk
    Author

    Deleting auth.json and logging in again fixed the issue. I guess the login token had expired? Should show the login screen again if the token is expired instead of just showing an error.

  3. changed the title [-]Not working[/-] [+]Authentication should show login again if token expired or other token error[/+] on Oct 25, 2025
  4. etraut-openai commented on Oct 25, 2025

    @etraut-openai
    Contributor

    Thanks for the bug report. I'm glad to hear that deleting auth.json worked for you. If this happens again, you can also log out (using the /logout command in the CLI or the "Log out" menu item in the extension).

    I presume you're logging with ChatGPT? Are you using the Codex CLI or the IDE extension? In either case, if your token expires, we should seamlessly refresh it for a new one.

  5. matssk commented on Oct 25, 2025

    @matssk
    Author

    Logging in with ChatGPT in Codex CLI

  6. Meowzz95 commented on Oct 26, 2025

    @Meowzz95

    @etraut-openai i think something is wrong with the refresh logic, I got the same thing today (reconnecting 5/5 and throws 401) I had to logout and login again to make it work

  7. added
    auth
    on Nov 15, 2025
  8. etraut-openai commented on Nov 15, 2025

    @etraut-openai
    Contributor

    In recent versions, we've updated the refresh logic to surface the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    authbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions