Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

If trusted issuer is supplied, offline function should load up the corresponding did document #56

Open
noway opened this issue Dec 4, 2021 · 2 comments

Comments

@noway
Copy link
Member

noway commented Dec 4, 2021

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

@fappaz
Copy link

fappaz commented Jul 23, 2022

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 });

@noway
Copy link
Member Author

noway commented Jul 24, 2022

Thanks for providing a workaround!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants