Skip to content

refactor: simplify user logout and login form query invalidation logic#208

Merged
pikann merged 3 commits into
masterfrom
refactor/simplify-user-logout
Jun 22, 2026
Merged

refactor: simplify user logout and login form query invalidation logic#208
pikann merged 3 commits into
masterfrom
refactor/simplify-user-logout

Conversation

@pikann

@pikann pikann commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Replaces the targeted, query-key-specific cache invalidation on login/logout with broader invalidation. This both simplifies the code and fixes stale user data (sidebar, permissions, projects, etc.) leaking across sessions.

  • user-menu.tsx — logout now calls queryClient.clear() instead of cancelling and removing only the ["auth", "me"] query, so no cached data from the previous user survives into the next session.
  • use-login-form.ts — login now invalidates the whole ["auth"] namespace instead of just ["auth", "me"], so the optional current-user query (["auth", "me-optional"], used by the sidebar) is refreshed too.

Net effect: fixes the previous user's data lingering after logout/login, with less code than the cancel/remove/invalidate calls it replaces.

@pikann pikann merged commit b8ad088 into master Jun 22, 2026
4 checks passed
@pikann pikann deleted the refactor/simplify-user-logout branch June 22, 2026 09:17
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.

1 participant