diff --git a/CHANGELOG.md b/CHANGELOG.md index fa5c217..3201dc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,9 @@ VC Verifier Changelog WIP --- + - allow arrays in the proof field of a verifiable +- assign basic presentation props to credential before verification 1.0.0 (2023-02-07) diff --git a/frontend/src/views/Verify.vue b/frontend/src/views/Verify.vue index 0e85b4f..57f8f86 100644 --- a/frontend/src/views/Verify.vue +++ b/frontend/src/views/Verify.vue @@ -37,8 +37,9 @@
{{ credential.id }}
- @@ -373,10 +374,18 @@ export default { const verifyTasks = Promise.all(this.verifiables.map(async (verifiable) => { if (getVerifiableType(verifiable) == VerifiableType.PRESENTATION) { - if (Array.isArray(verifiable.verifiableCredential)) this.credentials = this.credentials.concat(verifiable.verifiableCredential) - else this.credentials.push(verifiable.verifiableCredential) + + const presentation = { + holder: verifiable.holder, + challenge: verifiable.proof.challenge, + domain: verifiable.proof.domain + } + + if (Array.isArray(verifiable.verifiableCredential)) this.credentials = this.credentials.concat(verifiable.verifiableCredential.map((credential) => { return { ...credential, presentation } })); + else this.credentials.push({ ...verifiable.verifiableCredential, presentation }); + } else { - this.credentials.push(verifiable) + this.credentials.push(verifiable); } const res = await this.$api.post('/', [verifiable]); @@ -393,11 +402,11 @@ export default { holder: verifiable.holder, challenge: verifiable.proof.challenge, domain: verifiable.proof.domain, - status: 'verified' + status: 'verified!' } if (presentation.presentationResult && !presentation.verified) { - presentation.status = 'partially verified' + presentation.status = 'partially verified!' this.toast.warning(`Presentation of ${presentation.holder ? 'of holder' + presentation.holder.id || presentation.holder : ''} contains invalid credentials!`); }