diff --git a/services/api.ts b/services/api.ts index 0586f30..6f37b36 100644 --- a/services/api.ts +++ b/services/api.ts @@ -212,7 +212,7 @@ class ApiService { } } - // Clear WiFi passwords from SecureStore + // Clear WiFi passwords and encryption key from SecureStore try { await wifiPasswordStore.clearAllWiFiPasswords(); } catch (error) { @@ -220,6 +220,15 @@ class ApiService { // Continue with logout even if cleanup fails } + // Clear encryption key + try { + const { clearEncryptionKey } = await import('./encryption'); + await clearEncryptionKey(); + } catch (error) { + console.error('[API] Encryption key cleanup failed during logout:', error); + // Continue with logout even if cleanup fails + } + // Clear WellNuo API auth data await SecureStore.deleteItemAsync('accessToken'); await SecureStore.deleteItemAsync('userId');