Files
ColaFlow-Web/lib
Yaojia Wang 6f36bbc3d5 fix(frontend): Fix user field name mapping from backend to frontend
Resolved authentication issue where user.id was undefined, causing Epic creation to fail.

Root Cause:
- Backend /api/auth/login returns UserDto with PascalCase fields (Id, Email, etc.)
- Backend /api/auth/me returns JWT claims with camelCase (userId, email, etc.)
- Frontend User type expects camelCase fields (id, email, etc.)
- Previous code directly assigned backend fields without mapping

Changes:
- useLogin: Added field mapping to handle both PascalCase and camelCase
- useCurrentUser: Map userId -> id and tenantSlug -> tenantName
- Both functions now correctly populate user.id for localStorage persistence

Impact:
- Epic creation now works (user.id is correctly set)
- Auth state persists correctly across page reloads
- Consistent user object structure throughout frontend

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 21:03:39 +01:00
..
2025-11-03 00:04:07 +01:00
2025-11-03 00:04:07 +01:00