mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-22 22:49:28 -07:00
Fix handling of unverified proofs
This commit is contained in:
parent
80d5dd45d6
commit
c786b2cc10
1 changed files with 11 additions and 6 deletions
17
src/index.js
17
src/index.js
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue