This pull request introduces important improvements to authentication handling and session management in the frontend. The main changes ensure that API keys are only used when server authentication is disabled, implement robust cross-tab logout so users are logged out everywhere when their session ends, and add new utilities and tests to support these features.
Authentication and API Key Handling
- Updated both
apiServiceandSignalRServiceto only attach the API key to requests if server authentication is disabled, preventing accidental bypassing of login/logout flows. This is determined by checking both camelCase and PascalCase variants of theauthenticationRequiredflag for compatibility. [1] [2]
Cross-tab Session Management
- Enhanced
sessionTokenManagerinsessionToken.tsto support subscriber notifications on token changes, including handling storage events for cross-tab logout. Added theonTokenChangemethod and event handler for storage changes. [1] [2] [3] - Updated
auth.tsstore to react to token removals in other tabs by clearing user state and navigating to the login page, ensuring consistent logout across all open tabs. Also added comprehensive client-side cleanup during logout. [1] [2]
Testing and Utilities
- Added a new unit test in
sessionTokenStorage.test.tsto verify that su...
Automated canary build