haxxnz / nzcp-js

A verification library for COVID-19 Vaccine Passes in New Zealand
MIT License
36 stars 7 forks source link

Return cwtClaims Credential is returning null in a violation when it can be determined #50

Closed SimonCollings closed 2 years ago

SimonCollings commented 2 years ago

Expected Behavior

If there is a failure based on exp or iss (possibly others make sense as well) then the cwtClaims Credential should contain the information it can determine.

Actual Behavior

If there is a failure based on exp or iss (possibly others make sense as well) then the cwtClaims Credential is null, even though they have been determined.

Steps to Reproduce the Problem

  1. Verify a exp QR code
  2. See null info returned for the violation

Specifications

noway commented 2 years ago

This is fair enough, if the signature is valid we should return credentialSubject. I'll fix it.

noway commented 2 years ago

Fixed in https://github.com/vaxxnz/nzcp-js/releases/tag/1.0.2

SimonCollings commented 2 years ago

Amazing - thank you!! Works really well!