Skip to content

Commit

Permalink
Fix verifyPresentation (#113)
Browse files Browse the repository at this point in the history
The "verifyPresentation()" method was previously checking if a stream
had been revoked. However, when dealing with stream updates, the stream
remains unrevoked, causing "verifyPresentation()" to incorrectly return
true for old documents as well. This problem has been resolved by 
implementing the new check.
  • Loading branch information
adi-a11y authored Aug 18, 2023
1 parent 05ca9dd commit a2459c4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions demo/src/utils/verifyPresentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export async function verifyPresentation(
if (stream.revoked) {
return false
}
if (stream.streamHash !== presentation.documentHash) {
return false
}
return trustedIssuerUris.includes(stream.issuer)
} catch {
return false
Expand Down

0 comments on commit a2459c4

Please sign in to comment.