From 83ee9f86e2e30f2d47f252186201497a9945a3fe Mon Sep 17 00:00:00 2001 From: Yani Date: Wed, 15 May 2024 08:22:43 +0200 Subject: [PATCH] Fixed secure storage bug --- CHANGELOG.md | 8 ++++++++ .../secure_token_storage/fresh_secure_token_storage.dart | 2 +- pubspec.yaml | 6 +++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3378b47..f54cf63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 1.0.7 + +- Changed secure storage read because of breaking bug on iOS + +## 1.0.6 + +- Updated packages + ## 1.0.5 - Updated `dio` package 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 ac0f1cc..272d9f3 100644 --- a/lib/src/secure_token_storage/fresh_secure_token_storage.dart +++ b/lib/src/secure_token_storage/fresh_secure_token_storage.dart @@ -30,7 +30,7 @@ class FreshSecureTokenStorage implements TokenStorage { @override Future read() async { if (_token != null) return _token; - final tokenFromStorage = await storage.read(key: storageIdentifier); + final tokenFromStorage = (await storage.readAll())[storageIdentifier]; if (tokenFromStorage != null) { // ignore: join_return_with_assignment _token = tokenFromStorage.toOAuthToken; diff --git a/pubspec.yaml b/pubspec.yaml index 14b1305..b8566ca 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.5 +version: 1.0.7 homepage: https://github.com/wisemen-digital/flutter-networking-client repository: https://github.com/wisemen-digital/flutter-networking-client @@ -19,7 +19,7 @@ dependencies: fresh_dio: ^0.4.1 # Secure storage - flutter_secure_storage: ^9.0.0 + flutter_secure_storage: ^9.1.1 # Logging & Debugging native_dio_adapter: ^1.3.0 @@ -27,7 +27,7 @@ dependencies: dev_dependencies: # Static analysis & linting - lints: ^3.0.0 + lints: ^4.0.0 # Testing test: ^1.25.2