Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More debugging capabilities on MDL demo #39

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading