Skip to content

Commit

Permalink
fix: Translating issuanceDate to nbf
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat committed Apr 28, 2020
1 parent ed2c044 commit 51f0eff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/daf-w3c/src/action-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ const transformCredentialInput = (input: CredentialInput): VerifiableCredentialP
case 'type':
result['vc']['type'] = input[key]
break
case 'issuanceDate':
result['nbf'] = Date.parse(input[key]) / 1000
break
case 'expirationDate':
result['exp'] = Date.parse(input[key]) / 1000
break
Expand Down Expand Up @@ -169,6 +172,9 @@ const transformPresentationInput = (input: PresentationInput): PresentationPaylo
case 'type':
result['vp']['type'] = input[key]
break
case 'issuanceDate':
result['nbf'] = Date.parse(input[key]) / 1000
break
case 'expirationDate':
result['exp'] = Date.parse(input[key]) / 1000
break
Expand Down

0 comments on commit 51f0eff

Please sign in to comment.