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 { } else {
proofData = await serviceproviders.proxyRequestHandler(spData) proofData = await serviceproviders.proxyRequestHandler(spData)
} }
if (proofData) {
claimVerificationResult = claimVerification.run(proofData, spData)
if (!proofData) { continue } if (claimVerificationResult.errors.length == 0) {
claimVerificationDone = true
claimVerificationResult = claimVerification.run(proofData, spData) }
if (claimVerificationResult.errors.length == 0) {
claimVerificationDone = true
} }
iSp++ iSp++
} }
if (!claimVerificationResult) {
claimVerificationResult = {
isVerified: false
}
}
return { return {
isVerified: claimVerificationResult.isVerified, isVerified: claimVerificationResult.isVerified,
matchedServiceprovider: spData ? spData.serviceprovider.name : null, matchedServiceprovider: spData ? spData.serviceprovider.name : null,