Skip to content

Commit

Permalink
chore: Make sure we can work with selectively disclosed SD-JWTs, as t…
Browse files Browse the repository at this point in the history
…heir entryhash will be different when dropping disclosures
  • Loading branch information
nklomp committed Feb 18, 2025
1 parent a25619d commit 6b01738
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,11 @@ export class DidAuthSiopOpAuthenticator implements IAgentPlugin {
let uniqueDigitalCredentials: UniqueDigitalCredential[] = []
uniqueDigitalCredentials = verifiableCredentials.map((vc) => {
// @ts-ignore FIXME Funke
const hash = computeEntryHash(vc)
const udc = selectedCredentials.find((udc) => udc.hash == hash)
const hash = typeof vc === 'string' ? computeEntryHash(vc.split('~'[0])): computeEntryHash(vc)
const udc = selectedCredentials.find((udc) => udc.hash == hash || udc.originalVerifiableCredential == vc)

if (!udc) {
throw Error('UniqueDigitalCredential could not be found')
throw Error(`UniqueDigitalCredential could not be found in store. Either the credential is not present in the store or the hash is not correct.`)
}
return udc
})
Expand Down

0 comments on commit 6b01738

Please sign in to comment.