mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-22 14:39:28 -07:00
feat: add verification result validation function
This commit is contained in:
parent
ba6941448c
commit
264645b381
1 changed files with 8 additions and 1 deletions
|
@ -267,8 +267,15 @@ export class Claim {
|
||||||
viaProxy: proofData.viaProxy
|
viaProxy: proofData.viaProxy
|
||||||
}
|
}
|
||||||
|
|
||||||
// Post process the data
|
// Validate the result
|
||||||
const def = _data[claimData.about.id]
|
const def = _data[claimData.about.id]
|
||||||
|
if (def.functions?.validate && verificationResult.completed && verificationResult.result) {
|
||||||
|
try {
|
||||||
|
(verificationResult.result = await def.functions.validate(claimData, proofData, verificationResult, opts))
|
||||||
|
} catch (_) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Post process the data
|
||||||
if (def.functions?.postprocess) {
|
if (def.functions?.postprocess) {
|
||||||
try {
|
try {
|
||||||
({ claimData, proofData } = await def.functions.postprocess(claimData, proofData, opts))
|
({ claimData, proofData } = await def.functions.postprocess(claimData, proofData, opts))
|
||||||
|
|
Loading…
Reference in a new issue