Add offline mode support with PIN configuration and management
- Introduce `OfflinePinSetup` component for users to configure secure offline access. - Add new `AIUsageContext` and extend `OfflineProvider` for offline-related state management. - Implement offline login functionality in `electron/main.ts` with PIN verification and fallback support. - Enhance IPC handlers to manage offline mode data, PIN setup, and synchronization. - Update localization files (`en.json`, `fr.json`) with offline mode and PIN-related strings. - Add `bcrypt` and `@types/bcrypt` dependencies for secure PIN hashing and validation. - Refactor login and session management to handle offline mode scenarios with improved error handling and flow.
This commit is contained in:
@@ -891,5 +891,45 @@
|
||||
"message": "Sorry! This feature is reserved for advanced members. You must have a higher subscription or the advanced AI activation option.",
|
||||
"close": "Close"
|
||||
}
|
||||
},
|
||||
"offline": {
|
||||
"mode": {
|
||||
"title": "Offline Mode",
|
||||
"backToOnline": "Back to online login"
|
||||
},
|
||||
"pin": {
|
||||
"setup": {
|
||||
"title": "Configure PIN",
|
||||
"titleFirstLogin": "Secure your offline access",
|
||||
"subtitle": "Protect your local data",
|
||||
"description": "This PIN will allow you to access your works even without an internet connection",
|
||||
"pinLabel": "PIN Code (4-8 digits)",
|
||||
"confirmPinLabel": "Confirm PIN",
|
||||
"laterButton": "Later",
|
||||
"configureButton": "Configure PIN",
|
||||
"configuringButton": "Configuring...",
|
||||
"footer": "Your PIN is stored securely on your device"
|
||||
},
|
||||
"verify": {
|
||||
"title": "Offline Mode",
|
||||
"subtitle": "Enter your PIN to access your local works",
|
||||
"placeholder": "Enter your PIN",
|
||||
"enterPin": "Please enter your PIN",
|
||||
"incorrect": "Incorrect PIN",
|
||||
"tooManyAttempts": "Too many failed attempts. Please reconnect online.",
|
||||
"error": "Error verifying PIN",
|
||||
"cancelButton": "Cancel",
|
||||
"unlockButton": "Unlock",
|
||||
"verifyingButton": "Verifying...",
|
||||
"attemptsRemaining": "{{count}} attempt(s) remaining"
|
||||
},
|
||||
"errors": {
|
||||
"tooShort": "PIN must be at least 4 digits",
|
||||
"tooLong": "PIN cannot exceed 8 digits",
|
||||
"digitsOnly": "PIN must contain only digits",
|
||||
"mismatch": "PINs do not match",
|
||||
"setupFailed": "Error configuring PIN"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user