Pulse/frontend-modern/src/stores
rcourtman 059e8bf562 Redirect to login when authentication expires
Related to #626

When authentication expires after some time, users see "Connection lost"
and must refresh the page to see "Authentication required". This commit
implements automatic redirect to login when authentication expires.

Changes:
- Add authentication check to WebSocket endpoint to prevent unauthenticated
  WebSocket connections
- Handle WebSocket close with code 1008 (policy violation) as auth failure
  and redirect to login
- Intercept 401 responses on API calls (except initial auth checks) and
  automatically redirect to login page
- Clear stored credentials and set logout flag before redirect to ensure
  clean login flow

This provides a better user experience by immediately redirecting to the
login page when the session expires, rather than showing a confusing
"Connection lost" message that requires manual page refresh.
2025-11-05 19:36:01 +00:00
..
alertsActivation.ts Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
events.ts Fix settings security tab navigation 2025-10-11 23:29:47 +00:00
notifications.ts refactor: unify notifications into global toast 2025-10-22 12:39:01 +00:00
tokenReveal.ts Add reusable API token reveal dialog 2025-10-15 22:45:14 +00:00
updates.ts Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
websocket-global.ts Refactor: Code cleanup and localStorage consolidation 2025-11-04 21:50:46 +00:00
websocket.ts Redirect to login when authentication expires 2025-11-05 19:36:01 +00:00