From f091a1cd81a2dbb80bebd532e9a04e6e3530fad0 Mon Sep 17 00:00:00 2001 From: Yani Date: Tue, 4 Jun 2024 14:42:13 +0200 Subject: [PATCH] Reverted secure storage workaround and updated package --- CHANGELOG.md | 4 ++++ .../secure_token_storage/fresh_secure_token_storage.dart | 6 ++---- pubspec.yaml | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f54cf63..1785d02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.8 + +- Updated secure storage package and reverted workaround for efficiency + ## 1.0.7 - Changed secure storage read because of breaking bug on iOS diff --git a/lib/src/secure_token_storage/fresh_secure_token_storage.dart b/lib/src/secure_token_storage/fresh_secure_token_storage.dart index 272d9f3..e025c50 100644 --- a/lib/src/secure_token_storage/fresh_secure_token_storage.dart +++ b/lib/src/secure_token_storage/fresh_secure_token_storage.dart @@ -30,11 +30,9 @@ class FreshSecureTokenStorage implements TokenStorage { @override Future read() async { if (_token != null) return _token; - final tokenFromStorage = (await storage.readAll())[storageIdentifier]; + final tokenFromStorage = await storage.read(key: storageIdentifier); if (tokenFromStorage != null) { - // ignore: join_return_with_assignment - _token = tokenFromStorage.toOAuthToken; - return _token; + return tokenFromStorage.toOAuthToken; } else { return null; } diff --git a/pubspec.yaml b/pubspec.yaml index b8566ca..5511e44 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: wiseclient description: A http client based on Dio with extra features and a few interceptors for basic functionality. -version: 1.0.7 +version: 1.0.8 homepage: https://github.com/wisemen-digital/flutter-networking-client repository: https://github.com/wisemen-digital/flutter-networking-client @@ -19,11 +19,11 @@ dependencies: fresh_dio: ^0.4.1 # Secure storage - flutter_secure_storage: ^9.1.1 + flutter_secure_storage: ^9.2.2 # Logging & Debugging native_dio_adapter: ^1.3.0 - talker_dio_logger: ^4.1.3 + talker_dio_logger: ^4.2.3 dev_dependencies: # Static analysis & linting