Skip to content

Commit

Permalink
fix issuer error when string
Browse files Browse the repository at this point in the history
  • Loading branch information
jchartrand committed Oct 9, 2024
1 parent df74001 commit 1f196e4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ const issue = async (unsignedVerifiableCredential, instanceId) => {
return signedVerifiableCredential
}

const addIssuerId = (vc, issuerId) => {
if (vc.issuer && typeof vc.issuer === 'string') {
vc.issuer = issuerId
const addIssuerId = (credential, issuerId) => {
if (credential.issuer && typeof credential.issuer === 'string') {
credential.issuer = issuerId
} else {
;(vc.issuer ??= {}).id = issuerId
;(credential.issuer ??= {}).id = issuerId
}
}

Expand Down

0 comments on commit 1f196e4

Please sign in to comment.