Skip to content

Commit

Permalink
pick same Format fo vp_token as the one in presentation submission
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkbee1 committed Oct 25, 2024
1 parent 0dd0cda commit fac5bf2
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/scan/cubit/scan_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,6 @@ class ScanCubit extends Cubit<ScanState> {
clientMetaData: clientMetaData,
profileSetting: qrCodeScanCubit.profileCubit.state.model.profileSetting,
);

final String vpToken = await createVpToken(
credentialsToBePresented: credentialsToBePresented,
did: did,
Expand Down Expand Up @@ -830,7 +829,8 @@ class ScanCubit extends Cubit<ScanState> {
credentialsToBePresented: credentialsToBePresented,
);

if (supportingFormats.contains(VCFormatType.vcSdJWT)) {
// if (supportingFormats.contains(VCFormatType.vcSdJWT)) {
if (formatFromPresentationSubmission == VCFormatType.vcSdJWT) {
final credentialList = getStringCredentialsForToken(
credentialsToBePresented: credentialsToBePresented,
profileCubit: profileCubit,
Expand All @@ -840,9 +840,12 @@ class ScanCubit extends Cubit<ScanState> {
// considering only one

return vpToken;
} else if (supportingFormats.contains(VCFormatType.jwtVc) ||
supportingFormats.contains(VCFormatType.jwtVcJson) ||
supportingFormats.contains(VCFormatType.jwtVcJsonLd)) {
// } else if (supportingFormats.contains(VCFormatType.jwtVc) ||
// supportingFormats.contains(VCFormatType.jwtVcJson) ||
// supportingFormats.contains(VCFormatType.jwtVcJsonLd)) {
} else if (formatFromPresentationSubmission == VCFormatType.jwtVc ||
formatFromPresentationSubmission == VCFormatType.jwtVcJson ||
formatFromPresentationSubmission == VCFormatType.jwtVcJsonLd) {
final credentialList = getStringCredentialsForToken(
credentialsToBePresented: credentialsToBePresented,
profileCubit: profileCubit,
Expand All @@ -859,7 +862,8 @@ class ScanCubit extends Cubit<ScanState> {
);

return vpToken;
} else if (supportingFormats.contains(VCFormatType.ldpVc)) {
// } else if (supportingFormats.contains(VCFormatType.ldpVc)) {
} else if (formatFromPresentationSubmission == VCFormatType.ldpVc) {
/// proof is done with a creation date 20 seconds in the past to avoid
/// proof check to fail because of time difference on server
final options = jsonEncode({
Expand Down

0 comments on commit fac5bf2

Please sign in to comment.