Commit ff5514ad authored by taco@waag.org's avatar taco@waag.org
Browse files

fixed parsing result

parent cab4dea2
......@@ -72,7 +72,7 @@ function handleValidationResults(msg, responses, keys, values, envelopes, tab_id
console.log(responses);
//if all responses are VALID we show a green check mark
const valid = responses.every(function (response) {
return JSON.parse(response)["status"] == 'VALID';
return JSON.parse(response)["proofStatus"] == 'VALID';
});
//index resultset
......
......@@ -73,13 +73,13 @@ if (window.hasRun) {
}
function appendProof(fragment, result){
let status = result["status"];
let status = result["proofStatus"];
var proof_string = status;
if(status == "VALID"){
let email = result["email"];
let credential = result["id"];
let issuance_date = new Date(result["issuancetime"]*1000).toLocaleDateString("nl-NL");
let email = result.disclosed[0][0].rawvalue;
let credential = result.disclosed[0][0].id;
let issuance_date = new Date(result.disclosed[0][0].issuancetime*1000).toLocaleDateString("nl-NL");
proof_string = `${status} - signed using ${credential}: ${email} issued on ${issuance_date}.`
}
......@@ -103,7 +103,7 @@ if (window.hasRun) {
let header = document.createElement('h1');
header.textContent = content;
let status = result["status"];
let status = result["proofStatus"];
if(status == "VALID"){
appendCopyButton(fragment,type,content,signature);
}
......@@ -125,7 +125,7 @@ if (window.hasRun) {
let p = document.createElement('pre');
p.textContent = content;
let status = result["status"];
let status = result["proofStatus"];
if(status == "VALID"){
appendCopyButton(fragment,type,content,signature);
}
......@@ -146,7 +146,7 @@ if (window.hasRun) {
let p = document.createElement('pre');
p.textContent = content;
let status = result["status"];
let status = result["proofStatus"];
if(status == "VALID"){
appendCopyButton(fragment,type,content,signature);
}
......@@ -167,7 +167,7 @@ if (window.hasRun) {
let p = document.createElement('pre');
p.textContent = content;
let status = result["status"];
let status = result["proofStatus"];
if(status == "VALID"){
appendCopyButton(fragment,type,content,signature);
}
......@@ -188,7 +188,7 @@ if (window.hasRun) {
let p = document.createElement('img');
p.src = content;
let status = result["status"];
let status = result["proofStatus"];
if(status == "VALID"){
appendCopyButton(fragment,type,content,signature);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment