haxxnz / nzcp-js

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

Return a set of well defined errors from `validateCovidPassport` #6

Closed noway closed 3 years ago

noway commented 3 years ago

Currently Will is just returning false if a check fails.

For example in the spec it says

Check if the payload received from the QR Code begins with the prefix NZCP:/, if it does not then fail.

We should do something like

return { success: false, code: 100, message: "Payload must begin with \"NZCP:/\""}

J-eld commented 3 years ago

Hey, I'd like to work on this

wseagar commented 3 years ago

We're happy with the structure we landed on and now are just working though the spec.