Skip to content

Commit

Permalink
Merge pull request #39 from docknetwork/mdl-fix-request-debug
Browse files Browse the repository at this point in the history
More debugging capabilities on MDL demo
  • Loading branch information
cykoder authored Sep 12, 2024
2 parents 1f67923 + 67e2ffb commit cdb9b13
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pages/mdl.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,14 @@ function OID4VPProofRequest({ title, desc, proofRequestSetupObject, onPres, setE
const dataObj = JSON.parse(responseForServer.data);
if (dataObj.vp_token) {
// we must act as the client submitting the presentation now
await axios.post(`${baseUrl}/openid/vp/${proofRequest.id}/callback`, dataObj);
try {
await axios.post(`${baseUrl}/openid/vp/${proofRequest.id}/callback`, dataObj);
} catch (e) {
console.error(e);
throw new Error(
`Likely failed to verify or invalid data: ${JSON.stringify(dataObj, null, 2)} resp: ${JSON.stringify((e.response && e.response.data) || {}, null, 2)}`
);
}
} else {
throw new Error('Cannot find vp_token in creds api response');
}
Expand Down

0 comments on commit cdb9b13

Please sign in to comment.