feat: Refactor user UID retrieval to use user store across components
Summary
Fixed user UID handling across the frontend to ensure authenticated requests use the correct user identifier from the Zustand store instead of falling back to hardcoded development values.
Changes
Frontend (iavia-front):
- Updated axios.ts interceptor to retrieve user UID from useUserStore instead of localStorage
- Added check to preserve existing X-User-UUID header if already set by stores
- Removed hardcoded fallback dev-user-uuid-12345 from axios interceptor
- Modified indexation-store.ts to remove hardcoded http://localhost:8082 and dev-user-uuid-12345
- Updated S3, Google Drive, Slack, and Teams configuration components to use centralized user UID access
Backend (mobimarche-ai-service):
- Disabled CORS middleware in FastAPI (api_app.py) to prevent duplicate headers with Java Gateway
Problem
After login, API calls were sending dev-user-uuid-12345 instead of the real user UID because:
- User UID was stored encrypted via setSecureItem() with a hashed key
- Axios interceptor was reading directly from localStorage.getItem('userUid') which returned null
- CORS was configured in both FastAPI and Java Gateway, causing invalid duplicate headers
Solution
- Centralized user UID access through useUserStore.getState().currentUser?.uid
- Removed all hardcoded fallback values for user UID and API URLs
- Delegated CORS handling to Java Gateway only
Testing
- Login and verify correct userUid in console logs
- Create S3 account and verify backend receives correct userUid
- No CORS errors in browser console