mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-23 03:33:53 +00:00
fix: preserve theme preference on logout (addresses #318)
- Theme now persists when user logs out and logs back in - Added documentation for BACKEND_HOST environment variable (addresses #321) - Users can now bind to localhost only for reverse proxy setups - Improved documentation for network configuration options
This commit is contained in:
@@ -116,11 +116,16 @@ For backwards compatibility, some settings can be overridden via environment var
|
||||
1. **Authentication variables (from .env)** - Always highest priority
|
||||
- `PULSE_AUTH_USER`, `PULSE_AUTH_PASS`, `API_TOKEN`
|
||||
|
||||
2. **System settings (from system.json)** - Normal priority
|
||||
2. **Network binding variables** - For reverse proxy setups
|
||||
- `BACKEND_HOST` - IP address to bind to (default: `0.0.0.0`)
|
||||
- Set to `127.0.0.1` or `localhost` to only listen on localhost (for reverse proxy)
|
||||
- `FRONTEND_PORT` - Port to listen on (default: `7655`)
|
||||
|
||||
3. **System settings (from system.json)** - Normal priority
|
||||
- If system.json exists, it takes precedence
|
||||
- If missing, environment variables are checked
|
||||
|
||||
3. **Legacy environment variables** - Lowest priority (deprecated)
|
||||
4. **Legacy environment variables** - Lowest priority (deprecated)
|
||||
- `POLLING_INTERVAL` - Only used if system.json doesn't exist
|
||||
- `CONNECTION_TIMEOUT` - Can override system.json value
|
||||
- `ALLOWED_ORIGINS` - Can override system.json value
|
||||
|
||||
@@ -182,10 +182,15 @@ function App() {
|
||||
console.error('Logout error:', error);
|
||||
}
|
||||
|
||||
// Clear all local storage EXCEPT a flag indicating this is a logout
|
||||
// Clear all local storage EXCEPT theme preference and logout flag
|
||||
const currentTheme = localStorage.getItem('theme');
|
||||
localStorage.clear();
|
||||
sessionStorage.clear();
|
||||
localStorage.setItem('just_logged_out', 'true');
|
||||
// Preserve theme preference across logout
|
||||
if (currentTheme) {
|
||||
localStorage.setItem('theme', currentTheme);
|
||||
}
|
||||
|
||||
// Clear WebSocket connection
|
||||
if (wsStore()) {
|
||||
|
||||
Reference in New Issue
Block a user