Skip to content

Commit

Permalink
chore: mdoc VP fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderPostma committed Nov 20, 2024
1 parent 124522c commit 347c8f7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/siop-oid4vp/lib/authorization-response/OpenID4VP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,14 @@ export const assertValidVerifiablePresentations = async (args: {
if (!presentations || (Array.isArray(presentations) && presentations.length === 0)) {
return Promise.reject(Error('missing presentation(s)'))
}
const presentationsArray = Array.isArray(presentations) ? presentations : [presentations]

// Handle mdocs, keep them out of pex
let presentationsArray = (Array.isArray(presentations) ? presentations : [presentations])
if (presentationsArray.every(p => p.format === 'mso_mdoc')) {
return
}
presentationsArray = presentationsArray.filter((p) => p.format !== 'mso_mdoc')

if (
(!args.presentationDefinitions || args.presentationDefinitions.filter((a) => a.definition).length === 0) &&
(!presentationsArray || (Array.isArray(presentationsArray) && presentationsArray.filter((vp) => vp.presentation).length === 0))
Expand Down

0 comments on commit 347c8f7

Please sign in to comment.