Description
createDefaultUser() in user-context.tsx generates user IDs in the format "user_" + Date.now(). These are timestamp-based strings, not UUIDs. Once the frontend starts making real API calls, any endpoint that uses this ID (profile fetching, progress tracking, rewards, etc.) will fail because the backend expects and stores only proper UUIDs (e.g. 550e8400-e29b-41d4-a716-446655440000). This will cause silent failures that are hard to trace during integration.
// user-context.tsx — fake ID generation
const defaultUser: UserProfile = {
id: "user_" + Date.now(), // not a UUID, will never match a real DB record
fullName: name,
email: email,
role: "Student",
createdAt: new Date(),
};
Proposed Actions
Expected Outcome
- No fake user IDs are generated or stored anywhere in the frontend
- The
user state starts as null and is only populated by real API responses
- No UUID mismatch errors occur when API integration begins
Complexity
Trivial
Description
createDefaultUser()inuser-context.tsxgenerates user IDs in the format"user_" + Date.now(). These are timestamp-based strings, not UUIDs. Once the frontend starts making real API calls, any endpoint that uses this ID (profile fetching, progress tracking, rewards, etc.) will fail because the backend expects and stores only proper UUIDs (e.g.550e8400-e29b-41d4-a716-446655440000). This will cause silent failures that are hard to trace during integration.Proposed Actions
createDefaultUser()function fromuser-context.tsxentirely — it only exists to support the mock auth systemuserstate tonullinstead of callingcreateDefaultUser()userobject will be populated from the JWT token payload or/users/profileAPI response — it will always carry a real UUID from the backenduseris non-null to handle thenullcase gracefully (show loading state or redirect to login)Expected Outcome
userstate starts asnulland is only populated by real API responsesComplexity
Trivial