Files
ColaFlow-Web/stores
Yaojia Wang 605e151f33 fix(frontend): Add localStorage migration logic for userId to id field
Automatically migrate old localStorage format where user object has userId field
to new format with id field. This prevents users from needing to re-login after
the backend API response changed from userId to id.

Changes:
- Added migrate function to Zustand persist config to handle userId → id migration
- Added post-hydration safety check in onRehydrateStorage callback
- Added detailed console.log for debugging migration process

Fixes: User data mismatch after API response format change

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

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