Claude Desktop App stuck in login loop with 'Invalid authorization' error
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
- App launches and immediately gets
Invalid authorizationon every API query account_profiledata is undefined — profile cannot be fetchedFailed to fetch (claude.ai)— network requests to claude.ai fail- Magic link login returns
login_link_not_foundorlogin_link_already_used - CSP violation blocks requests to
https://a-api.anthropic.com/v1/m - Cookies DB shows a
pendingLogincookie but no session/auth cookie is ever created - The app gets stuck on the login page (
https://claude.ai/login?returnTo=%2Fmagic-link)
Steps to Reproduce
- Open Claude Desktop App on macOS
- App shows login screen
- Enter email, receive magic link
- Click magic link — app briefly loads then falls back to
Invalid authorization - 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.
Found 2 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/18474
- 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
Also having the same issue with the Desktop App. Browser and Code work fine
+1 - Having issues with desktop app.
+1
Likewise
same
Just got the same issue today.
+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.
Followed the below steps, and its working fine now,
- Uninstall Claude.app from Application, I did via terminal
rm -rf /Applications/Claude.app
- 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
- Restarted Mac
- Downloaded fresh copy of Claude app & Installed
- It worked.. !
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.
Confirming @alexis-alem's solution works.
I have the same issue with ssh into remote instance.
Can confirm @alexis-alem's solution works.
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 [email protected] 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.
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,
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.
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
- Log out of Claude Desktop
- App redirects to https://claude.ai/login?from=logout
- Log back in
- 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.
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
- Log out of Claude Desktop
- App redirects to https://claude.ai/login?from=logout
- Log back in
- 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 inThis 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
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.
I'm hesitant to
rm -rf ~/Library/Application\ Support/Claudebecause 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