Handle no matching service provider

This commit is contained in:
Yarmo Mackenbach 2020-10-25 01:06:45 +02:00
parent bdd918df4c
commit cbd86d81aa

View file

@ -34,7 +34,7 @@ const verify = async (uri, fingerprint, opts) => {
return spMatches return spMatches
} }
let claimHasBeenVerified = false, sp, iSp = 0, res, proofData let claimHasBeenVerified = false, sp, iSp = 0, res, proofData, spData = null
while (!claimHasBeenVerified && iSp < spMatches.length) { while (!claimHasBeenVerified && iSp < spMatches.length) {
spData = spMatches[iSp] spData = spMatches[iSp]
spData.claim.fingerprint = fingerprint spData.claim.fingerprint = fingerprint
@ -64,6 +64,7 @@ const verify = async (uri, fingerprint, opts) => {
return { return {
isVerified: claimHasBeenVerified, isVerified: claimHasBeenVerified,
matchedServiceprovider: spData ? spData.serviceprovider.name : null,
verificationData: spData verificationData: spData
} }
} }