Skip to content

Commit

Permalink
chore: mdoc fix in countVCsInAllVPs
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderPostma committed Nov 20, 2024
1 parent 1b8cc06 commit 08b9458
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/siopv2-oid4vp-op-auth/src/session/OpSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ export class OpSession {

private countVCsInAllVPs(verifiablePresentations: W3CVerifiablePresentation[], hasher?: Hasher) {
return verifiablePresentations.reduce((sum, vp) => {
if (CredentialMapper.isMsoMdocDecodedPresentation(vp) || CredentialMapper.isMsoMdocOid4VPEncoded(vp)) {
return sum + 1
}

const uvp = CredentialMapper.toUniformPresentation(vp, { hasher: hasher ?? this.options.hasher })
if (uvp.verifiableCredential?.length) {
return sum + uvp.verifiableCredential?.length
Expand Down

0 comments on commit 08b9458

Please sign in to comment.