From 96f8dcf32fe1c355e970eb9b57d3f39f5c122509 Mon Sep 17 00:00:00 2001 From: James Chartrand Date: Wed, 23 Oct 2024 10:48:29 -0400 Subject: [PATCH] add checks for credentialSubject --- src/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app.js b/src/app.js index cb9d9ab..365a774 100644 --- a/src/app.js +++ b/src/app.js @@ -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 = {}) {