From 5056f04a32ad09a96219f58709c43cd8844a50e9 Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Thu, 14 Nov 2024 23:46:59 +0100 Subject: [PATCH] chore: added isSdJwtDecodedCredential exception to countVCsInAllVPs because toUniformPresentation returns a sd-jwt vc and not vp --- packages/siopv2-oid4vp-op-auth/src/session/OpSession.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/siopv2-oid4vp-op-auth/src/session/OpSession.ts b/packages/siopv2-oid4vp-op-auth/src/session/OpSession.ts index 6fcb860f2..c083f7a97 100644 --- a/packages/siopv2-oid4vp-op-auth/src/session/OpSession.ts +++ b/packages/siopv2-oid4vp-op-auth/src/session/OpSession.ts @@ -373,7 +373,11 @@ export class OpSession { if (uvp.verifiableCredential?.length) { return sum + uvp.verifiableCredential?.length } - if (!PEX.allowMultipleVCsPerPresentation(uvp.verifiableCredential as Array)) { + const isSdJWT = CredentialMapper.isSdJwtDecodedCredential(uvp) + if ( + isSdJWT || + (uvp.verifiableCredential && !PEX.allowMultipleVCsPerPresentation(uvp.verifiableCredential as Array)) + ) { return sum + 1 } return sum