Skip to content

fix(mobile-auth): safely clear user state on logout - #382

Merged
Adamskiee merged 2 commits into
mainfrom
bugfix/mobile-host-override
Aug 18, 2026
Merged

fix(mobile-auth): safely clear user state on logout#382
Adamskiee merged 2 commits into
mainfrom
bugfix/mobile-host-override

Conversation

@Adamskiee

Copy link
Copy Markdown
Collaborator

fix(mobile-auth): safely clear user state on logout

  • Add clearUser() method to UserStore to clear in-memory state.
  • Update UserService logout and wipeDatabase methods to call clearUser().
  • Guard userStore.user accesses with userStore.hasUser check across 8 React components to prevent crashes when they re-render during the logout transition.

Verification

  • Tested mobile-app logout flow.

Note: Includes fix for 'Current user not initialized' crashes during logout transition.

…override.

Changed the Android network security configuration in app.config.ts from <domain-config> bound to server.sapot.lan to a global <base-config>. This ensures the custom CA is trusted universally, allowing preview and production builds to connect over HTTPS when the runtime host override is set to a custom IP or domain.
- Add clearUser() method to UserStore to clear in-memory state.
- Update UserService logout and wipeDatabase methods to call clearUser().
- Guard userStore.user accesses with userStore.hasUser check across 8 React components (index, map, public-chat, chat/[id], chat-list, message-list, use-peer-list-data, debug-panel) to prevent 'Current user not initialized' crashes when they re-render during the logout transition.
@Adamskiee
Adamskiee merged commit 8ed84b8 into main Aug 18, 2026
1 check failed
@Adamskiee
Adamskiee deleted the bugfix/mobile-host-override branch August 18, 2026 09:47
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