Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
SPHEREON-1157: presentationSubmission optional
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderPostma committed Feb 28, 2024
1 parent a026323 commit b74c350
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/authorization-response/AuthorizationResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,16 @@ export class AuthorizationResponse {

if (hasVpToken) {
const wrappedPresentations = await extractPresentationsFromAuthorizationResponse(response, { hasher: verifyOpts.hasher });
const presentationSubmission =
responseOpts.presentationExchange?.presentationSubmission ?? authorizationResponsePayload.presentation_submission;

await assertValidVerifiablePresentations({
presentationDefinitions,
presentations: wrappedPresentations,
verificationCallback: verifyOpts.verification.presentationVerificationCallback,
opts: {
...responseOpts.presentationExchange,
presentationSubmission: responseOpts.presentationExchange?.presentationSubmission ?? authorizationResponsePayload.presentation_submission,
...(presentationSubmission ? { presentationSubmission: presentationSubmission } : {}),
hasher: verifyOpts.hasher,
},
});
Expand Down

0 comments on commit b74c350

Please sign in to comment.