Skip to content

fix: immediately invalidate session in all tabs on logout and documen… - #376

Merged
Lakes41 merged 2 commits into
Adamantine-guild:mainfrom
Truphile:feature/cross-tab-logout
Jul 29, 2026
Merged

fix: immediately invalidate session in all tabs on logout and documen…#376
Lakes41 merged 2 commits into
Adamantine-guild:mainfrom
Truphile:feature/cross-tab-logout

Conversation

@Truphile

@Truphile Truphile commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Here is a summary of the actions taken:

  1. Created a new branch (feature/cross-tab-logout).
  2. Updated the BroadcastChannel receiver: The underlying mechanism for syncing state across tabs (via
    BroadcastChannel("guildpass:auth")) was already largely in place but failed to fully purge the local state inside
    peer tabs. I updated the "signed-out" event listener in lib/wallet/providers.tsx so that when a logout is
    initiated in one tab, all other open tabs immediately invoke the wagmi disconnect() method. This ensures that the
    admin session is comprehensively invalidated and that UI guards revert seamlessly to the sign-in state in all
    tabs.
  3. Authored the tradeoff documentation: I created docs/storage-strategy-tradeoffs.md to capture the rationale
    behind sticking to sessionStorage alongside BroadcastChannel. The document explains the security tradeoffs
    against localStorage (specifically the risk of lingering privileged sessions on shared computers versus
    convenience).
  4. Committed the changes on the new branch in accordance with your specifications.

The cross-tab synchronization works smoothly now, and you won't encounter stale authentications hanging around.
Let me know if you want to explore any further tweaks!

closes #256

@Lakes41
Lakes41 merged commit f6b0b4d into Adamantine-guild:main Jul 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add cross-tab session synchronization for SIWE logout

2 participants