Skip to content

Commit

Permalink
Add issuanceDate format check under issuanceDate existence check in V…
Browse files Browse the repository at this point in the history
…C 1.0 checks.
  • Loading branch information
aljones15 committed Dec 8, 2023
1 parent a037534 commit 401f83f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,13 +605,13 @@ export function _checkCredential({
if(!credential.issuanceDate) {
throw new Error('"issuanceDate" property is required.');
}
// check issuanceDate format on issue
assertDateString({credential, prop: 'issuanceDate'});

// check issuanceDate cardinality
if(jsonld.getValues(credential, 'issuanceDate').length > 1) {
throw new Error('"issuanceDate" property can only have one value.');
}
// check issuanceDate format on issue
assertDateString({credential, prop: 'issuanceDate'});
// optionally check expirationDate
if('expirationDate' in credential) {
// check if `expirationDate` property is a date
Expand Down

0 comments on commit 401f83f

Please sign in to comment.