Fix handling of unverified proofs

This commit is contained in:
Yarmo Mackenbach 2020-11-03 22:50:35 +01:00
parent 80d5dd45d6
commit c786b2cc10

View file

@ -45,18 +45,23 @@ const verify = async (uri, fingerprint, opts) => {
} else {
proofData = await serviceproviders.proxyRequestHandler(spData)
}
if (proofData) {
claimVerificationResult = claimVerification.run(proofData, spData)
if (!proofData) { continue }
claimVerificationResult = claimVerification.run(proofData, spData)
if (claimVerificationResult.errors.length == 0) {
claimVerificationDone = true
if (claimVerificationResult.errors.length == 0) {
claimVerificationDone = true
}
}
iSp++
}
if (!claimVerificationResult) {
claimVerificationResult = {
isVerified: false
}
}
return {
isVerified: claimVerificationResult.isVerified,
matchedServiceprovider: spData ? spData.serviceprovider.name : null,