From c786b2cc10bed41ec3772f7d5e033d0f114a60ed Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Tue, 3 Nov 2020 22:50:35 +0100 Subject: [PATCH] Fix handling of unverified proofs --- src/index.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/index.js b/src/index.js index 0bf0cac..360d106 100644 --- a/src/index.js +++ b/src/index.js @@ -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,