fix(mobile-auth): safely clear user state on logout - #382
Merged
Conversation
…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.
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.
fix(mobile-auth): safely clear user state on logout
Verification
Note: Includes fix for 'Current user not initialized' crashes during logout transition.