Skip to content

Commit

Permalink
add checks for credentialSubject
Browse files Browse the repository at this point in the history
  • Loading branch information
jchartrand committed Oct 23, 2024
1 parent d6d6904 commit 96f8dcf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ function isValidVC (unSignedVC) {
const isContextPropertyValid = isArrayOfStrings(unSignedVC['@context'])
const isTypePropertyValid = isArrayOfStrings(unSignedVC.type)
const isIssuerPropertyValid = (unSignedVC.issuer != null) && !Array.isArray(unSignedVC.issuer) && (typeof unSignedVC.issuer === 'string' || typeof unSignedVC.issuer === 'object')
return (isContextPropertyValid && isTypePropertyValid && isIssuerPropertyValid)
const isCredentialSubjectPropertyValid = (unSignedVC.credentialSubject != null) && !Array.isArray(unSignedVC.credentialSubject) && (typeof unSignedVC.credentialSubject === 'object')
return (isContextPropertyValid && isTypePropertyValid && isIssuerPropertyValid && isCredentialSubjectPropertyValid)
}

export async function build (opts = {}) {
Expand Down

0 comments on commit 96f8dcf

Please sign in to comment.