Skip to content

Commit

Permalink
handle properly presentJwtVcJsonLd to check presentation format
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkbee1 committed Oct 30, 2024
1 parent 271afa5 commit 1cf0bc1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/app/shared/helper_functions/helper_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1828,6 +1828,10 @@ List<VCFormatType> getPresentVCDetails({
/// jwt_vc_json
presentJwtVcJson = format?.jwtVcJson != null || format?.jwtVpJson != null;

/// jwt_vc_json_ld
presentJwtVcJsonLd =
format?.jwtVcJsonLd != null || format?.jwtVpJson != null;

/// vc+sd-jwt
presentVcSdJwt = format?.vcSdJwt != null;
} else {
Expand All @@ -1851,14 +1855,18 @@ List<VCFormatType> getPresentVCDetails({
presentJwtVcJson = vpFormats.containsKey('jwt_vc_json');

/// jwt_vc_json-ld
presentJwtVcJson = vpFormats.containsKey('jwt_vc_json-ld');
presentJwtVcJsonLd = vpFormats.containsKey('jwt_vc_json-ld');

/// vc+sd-jwt
presentVcSdJwt = vpFormats.containsKey('vc+sd-jwt');
}
}

if (!presentLdpVc && !presentJwtVc && !presentJwtVcJson && !presentVcSdJwt) {
if (!presentLdpVc &&
!presentJwtVc &&
!presentJwtVcJson &&
!presentJwtVcJsonLd &&
!presentVcSdJwt) {
throw ResponseMessage(
data: {
'error': 'invalid_request',
Expand Down

0 comments on commit 1cf0bc1

Please sign in to comment.