Fix login data structure and improve voice input UX
Some checks failed
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled
CI/CD Pipeline / Build Application (push) Has been cancelled

- 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:
2025-10-02 10:25:13 +00:00
parent 4b8828fdad
commit c60467b6f9
9 changed files with 231 additions and 120 deletions

View File

@@ -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,

View File

@@ -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;