Matthew Raymer
|
d355d51ea3
|
feat: centralize identity creation with router navigation guard
Migrate automatic identity creation from scattered view components to centralized
router navigation guard for consistent behavior across all entry points.
**Key Changes:**
- Add global beforeEach navigation guard in router/index.ts
- Remove automatic identity creation from HomeView, ContactsView, InviteOneAcceptView,
and OnboardMeetingMembersView
- Keep minimal fallback logic in deep link scenarios with logging
- Exclude manual identity creation routes (/start, /new-identifier, /import-account)
**Benefits:**
- Eliminates code duplication and race conditions
- Ensures consistent identity creation regardless of entry point
- Centralizes error handling with fallback to manual creation
- Improves maintainability with single point of change
**Files Modified:**
- src/router/index.ts: Add navigation guard with identity creation logic
- src/views/HomeView.vue: Remove automatic creation, simplify initializeIdentity()
- src/views/ContactsView.vue: Add fallback with logging
- src/views/InviteOneAcceptView.vue: Add fallback with logging
- src/views/OnboardMeetingMembersView.vue: Add fallback with logging
**Testing:**
- Verified first-time user navigation creates identity automatically
- Confirmed existing users bypass creation logic
- Validated manual creation routes remain unaffected
- Tested deep link scenarios with fallback logic
**Documentation:**
- Created docs/identity-creation-migration.md with comprehensive details
- Includes migration rationale, implementation details, testing scenarios
- Documents security considerations and rollback plan
Resolves inconsistent identity creation behavior across different app entry points.
|
2025-07-17 04:03:05 +00:00 |
|