Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secure storage issue #2664

Merged
merged 6 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions packages/oidc4vc/lib/src/oidc4vc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,12 @@ class OIDC4VC {
try {
final secureStorageProvider = getSecureStorage;
final cachedData = await secureStorageProvider.get(uri);
// TODO(hawkbee): To be removed.
/// temporary solution to purge faulty stored data
/// Will be removed in the future
await secureStorageProvider.delete(uri);

/// end of temporary solution
dynamic response;

dio.options.headers = headers;
Expand All @@ -1741,11 +1747,13 @@ class OIDC4VC {
return response;
}
}
final expiry =
DateTime.now().add(const Duration(days: 2)).millisecondsSinceEpoch;
// temporary deactiviting this caching du to issue with
// flutter_secure_storage on ios #2657
// final expiry =
// DateTime.now().add(const Duration(days: 2)).millisecondsSinceEpoch;

final value = {'expiry': expiry, 'data': response.data};
await secureStorageProvider.set(uri, jsonEncode(value));
// final value = {'expiry': expiry, 'data': response.data};
// await secureStorageProvider.set(uri, jsonEncode(value));

return response.data;
} on FormatException catch (_) {
Expand Down
2 changes: 1 addition & 1 deletion packages/secure_storage/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_secure_storage: ^9.2.1
flutter_secure_storage: 9.0.0

dev_dependencies:
flutter_test:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: altme
description: AltMe Flutter App
version: 2.5.4+453
version: 2.5.5+454

environment:
sdk: ">=3.1.0 <4.0.0"
Expand Down
Loading