Fix WebSocket authentication and duplicate filters
Some checks failed
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled
CI/CD Pipeline / Build Application (push) Has been cancelled

- Remove mock authentication from authSlice to enable real user login
- Fix WebSocket connection errors by using real JWT tokens
- Consolidate duplicate filters on insights page into single shared filter
- Update InsightsDashboard to accept props instead of managing own state
- Add MUI Grid styling for 20% min-width and centering
- Improve UX with unified filter controls for both insights and predictions
This commit is contained in:
2025-10-05 18:13:27 +00:00
parent d0b78181a3
commit 010c30637b
4 changed files with 53 additions and 120 deletions

View File

@@ -15,27 +15,10 @@ export interface AuthState {
loading: boolean;
}
// Mock user and token for development (TODO: Remove in production and implement real auth)
const MOCK_USER: User = {
id: 'user_test123',
email: 'test@maternal.app',
name: 'Test User',
familyId: 'fam_test123',
};
// Mock JWT token for development - this is just for testing, real auth needed in production
const MOCK_TOKEN = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ1c2VyX3Rlc3QxMjMiLCJmYW1pbHlJZCI6ImZhbV90ZXN0MTIzIiwiaWF0IjoxNjAwMDAwMDAwfQ.mock_signature_for_development';
// Set mock token in localStorage for development
if (typeof window !== 'undefined' && process.env.NODE_ENV === 'development') {
localStorage.setItem('accessToken', MOCK_TOKEN);
}
const initialState: AuthState = {
// Use mock user in development if no real user is stored
user: process.env.NODE_ENV === 'development' ? MOCK_USER : null,
token: process.env.NODE_ENV === 'development' ? MOCK_TOKEN : null,
isAuthenticated: process.env.NODE_ENV === 'development',
user: null,
token: null,
isAuthenticated: false,
loading: false,
};