Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[auth] Fix auth data key persistence on cold start (#7678)

Prateek Sunal69fec2e2d915
diff --cc mobile/apps/auth/lib/core/configuration.dart
index e6613a5758,f9487dbc89..bc1c496f9f
--- a/mobile/apps/auth/lib/core/configuration.dart
+++ b/mobile/apps/auth/lib/core/configuration.dart
@@@ -40,16 -41,14 +41,24 @@@ class Configuration extends BaseConfigu
);
}
+ Future<void> _initOnlineAccount() async {
+ if (hasConfiguredAccount()) {
+ _authSecretKey = await _secureStorage.read(
+ key: authSecretKeyKey,
+ );
+ }
+ }
+
+ @override
+ // This includes both base keys (key, secretKey) and auth-specific keys.
+ List<String> get secureStorageKeys => [
+ BaseConfiguration.keyKey,
+ BaseConfiguration.secretKeyKey,
+ authSecretKeyKey,
+ // Note: offlineAuthSecretKey is intentionally not included here
+ // as it persists across logouts
+ ];
+
@override
Future<void> logout({bool autoLogout = false}) async {
_authSecretKey = null;