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:
@@ -124,7 +124,7 @@ export const PlatformServiceMixin = {
|
||||
|
||||
/**
|
||||
* Access to in-memory logs array
|
||||
* Provides direct access to memoryLogs
|
||||
* Provides direct access to memoryLogs without requiring databaseUtil import
|
||||
*/
|
||||
$memoryLogs(): string[] {
|
||||
return _memoryLogs;
|
||||
@@ -159,7 +159,7 @@ export const PlatformServiceMixin = {
|
||||
|
||||
methods: {
|
||||
// =================================================
|
||||
// SELF-CONTAINED UTILITY METHODS
|
||||
// SELF-CONTAINED UTILITY METHODS (no databaseUtil dependency)
|
||||
// =================================================
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user