Migrate from electron-store to OS-level secure storage (getSecureStorage)
- Replace `electron-store` with OS-level encrypted storage for secure token, userId, and language management in `LocalSystem` and `keyManager`. - Add `init-user` IPC handler to initialize user data and manage encryption keys. - Update login process to handle encrypted storage saving with fallback for macOS issues. - Add offline warning component to `login/page.tsx` to handle first-time sync requirements. - Remove `electron-store` and associated dependencies from `package.json` and `package-lock.json`.
This commit is contained in:
5
electron.d.ts
vendored
5
electron.d.ts
vendored
@@ -23,9 +23,12 @@ export interface IElectronAPI {
|
||||
setLang: (lang: 'fr' | 'en') => Promise<void>;
|
||||
|
||||
// Auth events (one-way communication)
|
||||
loginSuccess: (token: string, userId: string) => void;
|
||||
loginSuccess: (token: string) => void;
|
||||
logout: () => void;
|
||||
|
||||
// User initialization (after getting user info from server)
|
||||
initUser: (userId: string) => Promise<{ success: boolean; keyCreated?: boolean; error?: string }>;
|
||||
|
||||
// Encryption key management (shortcuts for convenience)
|
||||
generateEncryptionKey: (userId: string) => Promise<string>;
|
||||
getUserEncryptionKey: (userId: string) => Promise<string | null>;
|
||||
|
||||
Reference in New Issue
Block a user