fix: skip citadel logout on disconnect when no SIWW session exists - #2538
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
chaitanyapotti
approved these changes
Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira Link
Description
External wallets connected in
connect-onlymode never complete SIWW (Sign-In With Wallet), so no citadel access/refresh tokens are stored. On disconnect,clearWalletSessionstill calledAuthSessionManager.logout(), which POSTs to/v1/auth/logouteven with an empty body — producing a noisy 401 Unauthorized in the console.This PR checks for access/refresh tokens before calling remote logout:
logout()as before (server session invalidated)clearSessionData()only (local cleanup, no API call)Affected path: all external-wallet connectors that use
BaseConnector.clearWalletSession(MetaMask, injected EVM, WalletConnect v2, etc.).How has this been tested?
packages/no-modal/test/baseConnector.test.tsassertingclearWalletSessionskipslogout()and callsclearSessionData()when no SIWW tokens existinitialAuthenticationMode: "connect-only") — disconnect no longer logs citadel 401Screenshots (if appropriate)
N/A — console-noise fix; no UI changes.
Types of changes
Checklist
Note
Low Risk
Small disconnect cleanup change: remote logout still runs when tokens exist, and local session data is still cleared. No auth-flow or token-issuance changes.
Overview
Stops connect-only disconnects from calling Citadel
logoutwhen there is no SIWW session, which previously produced noisy 401s.clearWalletSessionnow reads access/refresh tokens first. If either exists it still logs out remotely; otherwise it only clears local session data. Adds a unit test covering the no-token path.Reviewed by Cursor Bugbot for commit a47430c. Bugbot is set up for automated code reviews on this repo. Configure here.