diff --git a/lib/dashboard/profile/cubit/profile_cubit.dart b/lib/dashboard/profile/cubit/profile_cubit.dart index 2209ebda8..b771a4d84 100644 --- a/lib/dashboard/profile/cubit/profile_cubit.dart +++ b/lib/dashboard/profile/cubit/profile_cubit.dart @@ -152,19 +152,6 @@ class ProfileCubit extends Cubit { jsonDecode(customProfileSettingJsonString) as Map; - if (customProfileSettingMap['selfSovereignIdentityOptions'] - ['customOidc4vcProfile']['client_id'] == - null) { - customProfileSettingMap['selfSovereignIdentityOptions'] - ['customOidc4vcProfile']['client_id'] = Parameters.clientId; - } - if (customProfileSettingMap['selfSovereignIdentityOptions'] - ['customOidc4vcProfile']['client_secret'] == - null) { - customProfileSettingMap['selfSovereignIdentityOptions'] - ['customOidc4vcProfile']['client_secret'] = randomString(12); - } - profileSetting = ProfileSetting.fromJson(customProfileSettingMap); } else { profileSetting = ProfileSetting.initial(); @@ -546,15 +533,22 @@ class ProfileCubit extends Cubit { ), ); case ProfileType.custom: - final String customProfileSettingBackup = + final String? customProfileSettingBackup = await secureStorageProvider.get( - SecureStorageKeys.customProfileSettings, - ) ?? - jsonEncode(state.model.profileSetting); - final customProfileSetting = ProfileSetting.fromJson( - json.decode(customProfileSettingBackup) as Map, + SecureStorageKeys.customProfileSettings, ); + late ProfileSetting customProfileSetting; + + if (customProfileSettingBackup == null) { + customProfileSetting = ProfileSetting.initial(); + } else { + final profileJson = + json.decode(customProfileSettingBackup) as Map; + + customProfileSetting = ProfileSetting.fromJson(profileJson); + } + await update( state.model.copyWith( profileType: profileType, diff --git a/lib/dashboard/profile/models/profile_setting.dart b/lib/dashboard/profile/models/profile_setting.dart index b2f51eb70..53b01e34b 100644 --- a/lib/dashboard/profile/models/profile_setting.dart +++ b/lib/dashboard/profile/models/profile_setting.dart @@ -173,21 +173,21 @@ class DiscoverCardsOptions extends Equatable { required this.displayGender, required this.displayDefi, required this.displayHumanity, - required this.displayHumanityJwt, required this.displayOver13, required this.displayOver15, required this.displayOver18, - required this.displayOver18Jwt, required this.displayOver50, - required this.displayEmailPass, - required this.displayEmailPassJwt, - required this.displayPhonePass, - required this.displayPhonePassJwt, required this.displayVerifiableId, - required this.displayVerifiableIdJwt, required this.displayExternalIssuer, - required this.displayChainborn, - required this.displayTezotopia, + this.displayOver18Jwt = false, + this.displayVerifiableIdJwt = true, + this.displayEmailPass = true, + this.displayEmailPassJwt = true, + this.displayPhonePass = true, + this.displayPhonePassJwt = true, + this.displayChainborn = false, + this.displayTezotopia = false, + this.displayHumanityJwt = true, }); factory DiscoverCardsOptions.fromJson(Map json) => @@ -196,22 +196,13 @@ class DiscoverCardsOptions extends Equatable { factory DiscoverCardsOptions.initial() => const DiscoverCardsOptions( displayDefi: true, displayHumanity: true, - displayHumanityJwt: true, displayOver13: false, displayOver15: false, displayOver18: true, - displayOver18Jwt: false, displayOver21: false, displayOver50: false, - displayChainborn: false, - displayTezotopia: false, displayVerifiableId: true, - displayVerifiableIdJwt: true, displayOver65: false, - displayEmailPass: true, - displayEmailPassJwt: true, - displayPhonePass: true, - displayPhonePassJwt: true, displayAgeRange: false, displayGender: false, displayExternalIssuer: [], @@ -542,8 +533,8 @@ class CustomOidc4VcProfile extends Equatable { required this.securityLevel, required this.siopv2Draft, required this.clientType, - required this.clientId, - required this.clientSecret, + this.clientId = Parameters.clientId, + this.clientSecret = 'FGbzMrvUpeFr', this.vcFormatType = VCFormatType.jwtVcJson, this.proofHeader = ProofHeaderType.kid, }); @@ -556,13 +547,11 @@ class CustomOidc4VcProfile extends Equatable { oidc4vciDraft: OIDC4VCIDraftType.draft11, oidc4vpDraft: OIDC4VPDraftType.draft18, scope: false, - proofHeader: ProofHeaderType.kid, securityLevel: false, siopv2Draft: SIOPV2DraftType.draft12, clientType: ClientType.did, clientId: Parameters.clientId, clientSecret: randomString(12), - vcFormatType: VCFormatType.jwtVcJson, ); factory CustomOidc4VcProfile.fromJson(Map json) => @@ -658,7 +647,6 @@ class SettingsMenu extends Equatable { displayDeveloperMode: true, displayHelpCenter: true, displayProfile: true, - displaySelfSovereignIdentity: true, ); final bool displayDeveloperMode; diff --git a/pubspec.lock b/pubspec.lock index 8bd37bdf7..83b61f4c8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -619,10 +619,10 @@ packages: dependency: "direct main" description: name: dio - sha256: "797e1e341c3dd2f69f2dad42564a6feff3bfb87187d05abb93b9609e6f1645c3" + sha256: "49af28382aefc53562459104f64d16b9dfd1e8ef68c862d5af436cc8356ce5a8" url: "https://pub.dev" source: hosted - version: "5.4.0" + version: "5.4.1" dio_cache_interceptor: dependency: transitive description: @@ -779,10 +779,10 @@ packages: dependency: "direct main" description: name: file_saver - sha256: "8ffd91ae9f543c5ebbfec71a814ee5aa9e21176d31335133308abf63f4c42e8a" + sha256: f66e1732f6dbbef256171a18b8e493cd360c4fd53b2098eb48d47a6fd676f9ee url: "https://pub.dev" source: hosted - version: "0.2.9" + version: "0.2.10" file_selector_linux: dependency: transitive description: @@ -1413,10 +1413,10 @@ packages: dependency: transitive description: name: local_auth_android - sha256: "54e9c35ce52c06333355ab0d0f41e4c06dbca354b23426765ba41dfb1de27598" + sha256: "3bcd732dda7c75fcb7ddaef12e131230f53dcc8c00790d0d6efb3aa0fbbeda57" url: "https://pub.dev" source: hosted - version: "1.0.36" + version: "1.0.37" local_auth_ios: dependency: transitive description: @@ -2441,10 +2441,10 @@ packages: dependency: transitive description: name: url_launcher_platform_interface - sha256: a932c3a8082e118f80a475ce692fde89dc20fddb24c57360b96bc56f7035de1f + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.2" url_launcher_web: dependency: transitive description: