[BUG] OAuth timeout loop
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
I came back to my PC today and ran "claude -c" to continue yesterdays session but was greeted with:API Error: 401 <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
· Please run /login
I ran /login and followed all the steps in the browser (authorizing, copying the key). The whole OAuth flow was super slugish and unresponsive though, but eventually got through. When I pasted my key back into the terminal, it again took a while for something to happen but I got this: OAuth error: timeout of 15000ms exceeded
I tried multiple times, but it keeps happening. I can still open claude and it shows me as logged in, but when I try to send a message I get this:API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"Invalid authentication credentials"},"request_id":"req_011CYwTbuZNPX8ALRy1YyGHN"} · Please run /login
I am using Claude Code v2.1.72 on WSL2:WSL version: 2.6.1.0
Kernel version: 6.6.87.2-1
WSLg version: 1.0.66
MSRDC version: 1.2.6353
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26200.7840
I tested outside of WSL too, same issue. I don't think its a CC bug, but something wrong with the platforn. Raising this bug just for awareness. status.claude.com shows no issues.
What Should Happen?
I should be able to log into my account without OAuth timeouts.
Error Messages/Logs
Steps to Reproduce
- Open a terminal and run "wsl"
- in wsl, run "claude"
- run "/login"
- follow the steps on the browser screen. if the browser isnt opened automatically, copy the URL from the terminal into a browser, log into your Claude Account, and authorize
- copy the key/token from the browser back into the CLI and hit enter
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.72
Claude Code Version
2.1.72
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗