TF-928 Fix force logout when reload web

This commit is contained in:
dab246
2022-09-08 13:01:19 +07:00
committed by Dat H. Pham
parent 0838530775
commit aab8967c27
6 changed files with 26 additions and 27 deletions
@@ -98,14 +98,16 @@ class TokenOidcCacheClient extends HiveCacheClient<TokenOidcCache> {
@override
Future<Box<TokenOidcCache>> openBox() async {
return Future.sync(() async {
final encryptionKey = await getEncryptionKey();
final encryptionKey = await getEncryptionKey();
if (Hive.isBoxOpen(tableName)) {
return Hive.box<TokenOidcCache>(tableName);
} else {
return Hive.openBox<TokenOidcCache>(
tableName,
encryptionCipher: HiveAesCipher(encryptionKey!));
}).catchError((error) {
throw error;
});
encryptionCipher: encryptionKey != null
? HiveAesCipher(encryptionKey)
: null);
}
}
@override