nzcp-js
nzcp-js copied to clipboard
If trusted issuer is supplied, offline function should load up the corresponding did document
trafficstars
This will more closely resemble online version
verifyPassOffline(validExamplePass, { trustedIssuer: TRUSTED_ISSUERS.MOH_EXAMPLE }) // <-- this fails now
currently if you want to specify TRUSTED_ISSUERS.MOH_EXAMPLE trustedIssuer, you ALSO need to define didDocument
I second this :)
I thought the function was already doing that, but it turns out DID_DOCUMENTS.MOH_LIVE is the fallback when didDocument isn't provided in the options param.
In case somebody else come across the same issue, this code should suffice:
const trustedIssuer = TRUSTED_ISSUERS.MOH_EXAMPLE;
const didDocument = Object.values(DID_DOCUMENTS).find(document => document.id === trustedIssuer);
verifyPassURIOffline(validExamplePass, { trustedIssuer, didDocument });
Thanks for providing a workaround!