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.
This commit is contained in:
Matthew Raymer
2025-07-17 04:03:05 +00:00
parent 5c7f58b5c8
commit d355d51ea3
15 changed files with 1121 additions and 99 deletions

View File

@@ -1686,3 +1686,10 @@ export const PUSH_NOTIFICATION_TIMEOUT_PERSISTENT = -1;
// InviteOneAcceptView.vue timeout constants
export const INVITE_TIMEOUT_STANDARD = 3000; // Standard error messages
export const INVITE_TIMEOUT_LONG = 5000; // Missing invite and invalid data errors
// ContactsView.vue specific constants
// Used in: ContactsView.vue (showOnboardingInfo method - simple confirmation dialog)
export const NOTIFY_CONTACTS_ADDED_CONFIRM = {
title: "They're Added To Your List",
message: "Would you like to go to the main page now?",
};