From 1809d9104b5c92d9c3dcd29be0c08134fff797b9 Mon Sep 17 00:00:00 2001 From: lastlink Date: Tue, 7 May 2019 11:52:46 -0400 Subject: [PATCH] some cleanup --- app.js | 23 +++++++++++------------ index.html | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/app.js b/app.js index 24f2ebc..7bf7564 100644 --- a/app.js +++ b/app.js @@ -144,18 +144,17 @@ var msgArr = msg.split(".") var protected64 = msgArr[0] var payload64 = msgArr[1] - Keypairs._sign(opts, msg).then(function (buf) { - var signedMsg = { - protected: protected64 - , payload: payload64 - , signature: Enc.bufToUrlBase64(buf) - }; - $('.js-jws').innerText = JSON.stringify(signedMsg); - $('.js-toc-jws').hidden = false; - $('.js-pem-loading').hidden = true; - $$('input').map(function ($el) { $el.disabled = false; }); - $$('button').map(function ($el) { $el.disabled = false; }); - }); + var signature = msgArr[2] + var signedMsg = { + protected: protected64 + , payload: payload64 + , signature + }; + $('.js-jws').innerText = JSON.stringify(signedMsg, null, 2); + $('.js-toc-jws').hidden = false; + $('.js-pem-loading').hidden = true; + $$('input').map(function ($el) { $el.disabled = false; }); + $$('button').map(function ($el) { $el.disabled = false; }); }) // jws = jwk.sign(payload) diff --git a/index.html b/index.html index 8afe337..00298de 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@ height: 10em; } /* need to word wrap the binary no space der */ - .js-der-public, .js-der-private{ + .js-der-public, .js-der-private, .js-jwt{ white-space: pre-wrap; /* CSS3 */ white-space: -moz-pre-wrap; /* Firefox */ white-space: -pre-wrap; /* Opera <7 */