Fix login data structure and improve voice input UX
- Fix login endpoint to return families as array of objects instead of strings - Update auth interface to match /auth/me endpoint structure - Add silence detection to voice input (auto-stop after 1.5s) - Add comprehensive status messages to voice modal (Listening, Understanding, Saving) - Unify voice input flow to use MediaRecorder + backend for all platforms - Add null checks to prevent tracking page crashes from invalid data - Wait for auth completion before loading family data in HomePage 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -164,8 +164,12 @@ export class AuthService {
|
||||
// Generate tokens
|
||||
const tokens = await this.generateTokens(user, device.id);
|
||||
|
||||
// Get family IDs
|
||||
const familyIds = user.familyMemberships?.map((fm) => fm.familyId) || [];
|
||||
// Get families with proper structure (matching /auth/me endpoint)
|
||||
const families = user.familyMemberships?.map((fm) => ({
|
||||
id: fm.familyId,
|
||||
familyId: fm.familyId,
|
||||
role: fm.role,
|
||||
})) || [];
|
||||
|
||||
// Audit log: successful login
|
||||
await this.auditService.logLogin(user.id);
|
||||
@@ -180,7 +184,7 @@ export class AuthService {
|
||||
locale: user.locale,
|
||||
emailVerified: user.emailVerified,
|
||||
preferences: user.preferences,
|
||||
families: familyIds,
|
||||
families: families,
|
||||
},
|
||||
tokens,
|
||||
requiresMFA: false,
|
||||
|
||||
@@ -13,7 +13,7 @@ export interface AuthResponse {
|
||||
name: string;
|
||||
locale: string;
|
||||
emailVerified: boolean;
|
||||
families?: string[];
|
||||
families?: Array<{ id: string; familyId: string; role: string }>;
|
||||
preferences?: any;
|
||||
};
|
||||
tokens: AuthTokens;
|
||||
|
||||
Reference in New Issue
Block a user