Claude Desktop App stuck in login loop with 'Invalid authorization' error

Open 💬 29 comments Opened Feb 3, 2026 by SingCheung

Bug Description

Claude Desktop App (v1.1.1520) on macOS is unable to authenticate. Every launch immediately produces Invalid authorization errors from the REACT_QUERY_CLIENT. Login via magic link fails repeatedly. The app is completely unusable.

Environment

  • App version: 1.1.1520
  • Platform: macOS (darwin, arm64)
  • Node version: 22.21.1
  • CCD version: 2.1.22

Error Logs

From ~/Library/Logs/Claude/claude.ai-web.log:

2026-02-02 18:32:42 [error] [REACT_QUERY_CLIENT] QueryClient error: Error: Invalid authorization
2026-02-02 18:33:16 [error] [REACT_QUERY_CLIENT] QueryClient error: TypeError: Failed to fetch (claude.ai)
2026-02-02 18:33:16 [error] [REACT_QUERY_CLIENT] QueryClient error: Error: Invalid authorization
2026-02-02 19:03:43 [error] [REACT_QUERY_CLIENT] QueryClient error: Error: login_link_not_found
2026-02-02 19:38:50 [error] [REACT_QUERY_CLIENT] QueryClient error: Error: login_link_already_used
2026-02-02 20:37:40 [error] Refused to connect to 'https://a-api.anthropic.com/v1/m' because it violates the following Content Security Policy directive: "connect-src 'self' https://api.segment.io https://*.segment.io https://*.segment.com https://a-cdn.anthropic.com https://*.google.com https://*.facebook.com https://*.facebook.net https://*.doubleclick.net".
2026-02-02 20:37:40 [error] Fetch API cannot load https://a-api.anthropic.com/v1/m. Refused to connect because it violates the document's Content Security Policy.
2026-02-02 20:48:56 [error] [REACT_QUERY_CLIENT] QueryClient error: Error: ["account_profile"] data is undefined

These errors repeat on every app launch. The app was restarted 10+ times over ~3.5 hours with the same result every time.

Symptoms

  1. App launches and immediately gets Invalid authorization on every API query
  2. account_profile data is undefined — profile cannot be fetched
  3. Failed to fetch (claude.ai) — network requests to claude.ai fail
  4. Magic link login returns login_link_not_found or login_link_already_used
  5. CSP violation blocks requests to https://a-api.anthropic.com/v1/m
  6. Cookies DB shows a pendingLogin cookie but no session/auth cookie is ever created
  7. The app gets stuck on the login page (https://claude.ai/login?returnTo=%2Fmagic-link)

Steps to Reproduce

  1. Open Claude Desktop App on macOS
  2. App shows login screen
  3. Enter email, receive magic link
  4. Click magic link — app briefly loads then falls back to Invalid authorization
  5. All subsequent API calls fail

Troubleshooting Already Attempted (all failed)

  • Full quit and relaunch (10+ times)
  • Complete deletion of ~/Library/Application Support/Claude/ (cookies, local storage, session storage, config, caches, network state)
  • Deletion of ~/Library/Caches/Claude/
  • Deletion of ~/Library/Preferences/com.anthropic.claudefordesktop.plist
  • Deletion of ~/Library/Saved Application State/com.anthropic.claudefordesktop.savedState
  • Deletion of ~/Library/WebKit/ and ~/Library/HTTPStorages/ for Claude
  • defaults delete com.anthropic.claudefordesktop
  • Checked macOS Keychain — no Claude/Anthropic entries found
  • Tried logging in via browser first, then opening desktop app
  • Tried older versions of the app
  • No VPN or DNS filter active

Possibly Related Issues

  • #20016 (Cowork tab stuck / Invalid authorization)
  • #18474 (Claude Cowork stuck on 'sending request')
  • #10503 (Invalid bearer token persists after login)

Expected Behavior

App should authenticate successfully after clicking the magic link and display the main chat interface.

Actual Behavior

App is stuck in an infinite login loop. Auth token is never persisted. All API calls return Invalid authorization.

View original on GitHub ↗

29 Comments

github-actions[bot] · 5 months ago

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/18474
  2. https://github.com/anthropics/claude-code/issues/20136

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

Jbarata98 · 5 months ago

Also having the same issue with the Desktop App. Browser and Code work fine

Arvindh-Mojo · 5 months ago

+1 - Having issues with desktop app.

martinsober · 5 months ago

+1

jondashkyle · 5 months ago

Likewise

defcube · 5 months ago

same

sbusso · 4 months ago

Just got the same issue today.

saigop · 4 months ago

+1 for me on Claude Mac OS Desktop App, Am in version 1.1.3189(1b7b58) keep on looping on the cloudflare login page, browser works fine, restarted the machine still its same.

saigop · 4 months ago

Followed the below steps, and its working fine now,

  1. Uninstall Claude.app from Application, I did via terminal
rm -rf /Applications/Claude.app
  1. Remove Cache, Application Support and preferences
rm -rf ~/Library/Application\ Support/Claude rm -rf ~/Library/Caches/Claude rm -rf ~/Library/Preferences/com.anthropic.claude.plist rm -rf ~/Library/Saved\ Application\ State/com.anthropic.claude.savedState rm -rf ~/Library/Logs/Claude
  1. Restarted Mac
  2. Downloaded fresh copy of Claude app & Installed
  3. It worked.. !
alexis-alem · 4 months ago

Fix for Cloudflare login loop — preserving Cowork chats

Had the same issue (macOS, Cloudflare verification loop, app-specific — browser worked fine). Things that didn't work: changing DNS to Google (8.8.8.8), flushing DNS cache, tethering to mobile hotspot, deleting only Caches/Preferences/SavedState, or selectively clearing auth files (Cookies, Session Storage, Local Storage, etc.).

What did work was wiping ~/Library/Application Support/Claude — but with a backup step to preserve Cowork local chats:

# 1. Back up Cowork chats (stored only locally)
cp -r ~/Library/Application\ Support/Claude/local-agent-mode-sessions ~/Desktop/cowork-backup

# 2. Wipe app data
rm -rf ~/Library/Application\ Support/Claude
rm -rf ~/Library/Caches/Claude

# 3. Cmd+Q Claude and reopen — login should work

# 4. Restore Cowork chats
cp -r ~/Desktop/cowork-backup ~/Library/Application\ Support/Claude/local-agent-mode-sessions

No need to uninstall the app, restart the Mac, or re-download. All Cowork chat history was preserved.

onewil · 4 months ago

Confirming @alexis-alem's solution works.

macman123 · 4 months ago

I have the same issue with ssh into remote instance.

princess-mimi-stackd · 4 months ago

Can confirm @alexis-alem's solution works.

jwuttke · 4 months ago

Similar problem with Claude Code (CC) terminal frontend on Linux:

  • me: Launch claude
  • me: Log-in via browser
  • CC: "Login successful. Press Enter to continue…"
  • me: Enter
  • CC: prompt
  • me: whatsoever
  • CC: "Your account does not have access to Claude Code. Please run /login."

Complete purge and reinstallation did not help.

Deleting and recreating the Team seat did not help.

Support request to support@mail.anthropic.com is answered by a clueless bot. After a couple of iterations, the bot mentioned the possibility of human intervention and fell silent. Now waiting since 10 days for a human @ Anthropic to respond.

macman123 · 4 months ago
I have the same issue with ssh into remote instance.

I had to install CLI version of the Claude in a terminal and run login there, then it started working in VS code,

jwuttke · 4 months ago

Solution to my endless log-in logged-out loop, https://github.com/anthropics/claude-code/issues/22685#issuecomment-4030150382:

There was an environment variable CLAUDE_CODE_OAUTH_TOKEN. Removing it solved the problem.

The lack of a clear error message is a severe bug of Claude Code.

sheyaln · 3 months ago

Looks like there might be a regression in v1.1.7203 (034f07) — 2026-03-17.
The app fails to clear the sessionKey cookie on logout, causing an auth loop on re-login.

Environment

  • App version: 1.1.7203 (034f07), 2026-03-17T17:48:28.000Z
  • Platform: macOS (darwin, arm64)

Reproduction

  1. Log out of Claude Desktop
  2. App redirects to https://claude.ai/login?from=logout
  3. Log back in
  4. App enters an infinite auth loop — never reaches the main UI

Log sequence from ~/Library/Logs/Claude/main.log

  Identity changed (loggedOut: true → false, uuid: <none> → <uuid>)                                                     
  [oauth] performing fresh oauth exchange for orgId=<orgId>                                                             
  oauth failed: no sessionKey cookie found                                                                              
  [oauth] failed to obtain oauth token (not_logged_in): no sessionKey cookie found                                      
  [RemotePluginManager] Sync failed: Failed to fetch auto-installed plugins (HTTP 403)                                  
  Failed to fetch skills list: 403 {"error":{"type":"permission_error","message":"Invalid                               
  authorization","details":{"error_code":"account_session_invalid"}}}                                                   
  Cannot get base query config: oauth failed (not_logged_in): no sessionKey cookie found                                
  Identity changed (loggedOut: false → true, uuid: <uuid> → <none>)                                                     

This cycle repeats indefinitely. The app detects an account, attempts OAuth, finds no valid session cookie, gets 403,
logs out, and starts over.

Workaround:

Deleting the cookie store breaks the loop:
```

Quit Claude Desktop first

rm ~/Library/Application\ Support/Claude/Cookies
rm ~/Library/Application\ Support/Claude/Cookies-journal

Relaunch and log in

 
This must be repeated every time you log out — the logout flow consistently leaves the cookie store in a broken state.
No stale env vars (CLAUDE_CODE_OAUTH_TOKEN etc.) are present.
chiragpurohit71085 · 3 months ago
Looks like there might be a regression in v1.1.7203 (034f07) — 2026-03-17. The app fails to clear the sessionKey cookie on logout, causing an auth loop on re-login. Environment App version: 1.1.7203 (034f07), 2026-03-17T17:48:28.000Z Platform: macOS (darwin, arm64) Reproduction 1. Log out of Claude Desktop 2. App redirects to https://claude.ai/login?from=logout 3. Log back in 4. App enters an infinite auth loop — never reaches the main UI Log sequence from ~/Library/Logs/Claude/main.log `` Identity changed (loggedOut: true → false, uuid: <none> → <uuid>) [oauth] performing fresh oauth exchange for orgId=<orgId> oauth failed: no sessionKey cookie found [oauth] failed to obtain oauth token (not_logged_in): no sessionKey cookie found [RemotePluginManager] Sync failed: Failed to fetch auto-installed plugins (HTTP 403) Failed to fetch skills list: 403 {"error":{"type":"permission_error","message":"Invalid authorization","details":{"error_code":"account_session_invalid"}}} Cannot get base query config: oauth failed (not_logged_in): no sessionKey cookie found Identity changed (loggedOut: false → true, uuid: <uuid> → <none>) ` This cycle repeats indefinitely. The app detects an account, attempts OAuth, finds no valid session cookie, gets 403, logs out, and starts over. Workaround: Deleting the cookie store breaks the loop: ` # Quit Claude Desktop first rm ~/Library/Application\ Support/Claude/Cookies rm ~/Library/Application\ Support/Claude/Cookies-journal # Relaunch and log in `` This must be repeated every time you log out — the logout flow consistently leaves the cookie store in a broken state. No stale env vars (CLAUDE_CODE_OAUTH_TOKEN etc.) are present.

This solution did not work for me.
I have
Claude 1.1.7714 (3bd6f6) 2026-03-19T14:50:53.000Z

5amfung · 3 months ago

I'm hesitant to rm -rf ~/Library/Application\ Support/Claude because my Claude Code CLI is still working. I don't know if it shares anything in the same directory. But Claude Desktop is still in login loop after deleting the cookies and cookies-journal.

sheyaln · 3 months ago
I'm hesitant to rm -rf ~/Library/Application\ Support/Claude because my Claude Code CLI is still working. I don't know if it shares anything in the same directory. But Claude Desktop is still in login loop after deleting the cookies and cookies-journal.

What do your logs look like during the loop?
~/Library/Logs/Claude/main.log

5amfung · 3 months ago

Very strange. I waited 30mins and Claude Desktop is running again without the infinite login loop 🤯

quintenrosseel · 3 months ago

Running unset CLAUDE_CODE_OAUTH_TOKEN did the trick for me. Very frustrating bug.

Skeletoneyes · 2 months ago

This is happening for me on Windows. https://github.com/anthropics/claude-code/issues/59803

I've tried the following, and all failed to resolve:

  1. Uninstall and reinstall the Claude Desktop app
  2. Checked for CLAUDE_CODE_OAUTH_TOKEN environment variable — not present
  3. Deleted cookie store only (%APPDATA%\Claude\Cookies and Cookies-journal)
  4. Full wipe of app data (%APPDATA%\Claude, %LOCALAPPDATA%\Claude, %LOCALAPPDATA%\AnthropicClaude)
  5. Ran Claude Desktop as Administrator
  6. Tried both Google OAuth and email/magic link login — both fail the same way
  7. No VPN active during attempts
hosamn · 1 month ago

I was also experiencing this issue on Windows and Firefox.
After trying a few things that didn't work, I was finally able to resolve it on this machine by disabling the ClearURLs browser extension. turns out having this extension enabled prevents secure links from working.

ChrisDoufu · 1 month ago
I was also experiencing this issue on Windows and Firefox. After trying a few things that didn't work, I was finally able to resolve it on this machine by disabling the ClearURLs browser extension. turns out having this extension enabled prevents secure links from working.

OMG this works finally, save my day!!

imagochan · 1 month ago
I was also experiencing this issue on Windows and Firefox. After trying a few things that didn't work, I was finally able to resolve it on this machine by disabling the ClearURLs browser extension. turns out having this extension enabled prevents secure links from working.

this solved my issue too, thanks!

EthanBM · 1 month ago
I was also experiencing this issue on Windows and Firefox. After trying a few things that didn't work, I was finally able to resolve it on this machine by disabling the ClearURLs browser extension. turns out having this extension enabled prevents secure links from working.

That helps! I successfully verified my account after disabling all the extensions that might have VPN functionality.

DuckTapeKiller · 1 month ago

I am having this issue as well.

qwrrty · 25 days ago

Several other people observed that removing the "CleanURLs" browser extension resolved this problem, which I have also confirmed. This has been confirmed to be a bug in CleanURLs. Issue https://github.com/ClearURLs/Addon/issues/510 is tracking the bug and PR https://github.com/ClearURLs/Addon/pull/514 has been opened to fix it: please go upvote those.