From 6e0139db79820f3e74166049371b757ee6d6d357 Mon Sep 17 00:00:00 2001 From: Marnix Dessing Date: Sun, 16 Oct 2022 20:39:52 +0200 Subject: [PATCH] feat: removed session token from issue page --- src/app/issue/homeRequestHandler.ts | 2 -- src/app/static-resources/static/scripts/issue.js | 11 +++++------ src/app/templates/issue.mustache | 1 - 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/app/issue/homeRequestHandler.ts b/src/app/issue/homeRequestHandler.ts index 95f3d1ad..ce576d93 100644 --- a/src/app/issue/homeRequestHandler.ts +++ b/src/app/issue/homeRequestHandler.ts @@ -38,7 +38,6 @@ async function handleLoggedinRequest(session: Session, brpClient: ApiClient, irm let irmaSession = { irmaSessionPtrU: undefined, irmaSessionPtrQr: undefined, - irmaSessionToken: undefined, }; if (!brpFailed) { // Start IRMA session @@ -48,7 +47,6 @@ async function handleLoggedinRequest(session: Session, brpClient: ApiClient, irm } else { irmaSession.irmaSessionPtrQr = irmaResponse.sessionPtr.irmaqr; irmaSession.irmaSessionPtrU = irmaResponse.sessionPtr.u; - irmaSession.irmaSessionToken = irmaResponse.token; } } diff --git a/src/app/static-resources/static/scripts/issue.js b/src/app/static-resources/static/scripts/issue.js index a548c9e7..dce1a046 100644 --- a/src/app/static-resources/static/scripts/issue.js +++ b/src/app/static-resources/static/scripts/issue.js @@ -1,4 +1,3 @@ -const sessionToken = document.getElementById("session-token").value; const sessionPtrU = document.getElementById("session-ptr-u").value; const sessionPtrQr = document.getElementById("session-ptr-qr").value; const irmaServer = document.getElementById("irmaServer").value; @@ -9,12 +8,11 @@ const irmaClient = irma.newWeb({ element: '#irma-web-form', session: { url: irmaServer, - start: false, + start: false, // No need to start session from the browser (done server-sied) mapping: { sessionPtr: r => { return { "u": sessionPtrU, "irmaqr": sessionPtrQr } }, - sessionToken: r => { return sessionToken }, }, - result: false, + result: false, // No need to fetch session result (status success / failed is sufficient) }, state: { serverSentEvents: false, @@ -22,10 +20,11 @@ const irmaClient = irma.newWeb({ }); irmaClient.start() - .then(() => { + .then(() => { // Hide QR show success message document.getElementById('irma-form').classList.add("hidden"); document.getElementById('success').classList.remove("hidden"); }) - .catch(() => { + .catch(() => { // Hide QR show error message + document.getElementById('irma-form').classList.add("hidden"); document.getElementById('failed-irma').classList.remove("hidden"); }); \ No newline at end of file diff --git a/src/app/templates/issue.mustache b/src/app/templates/issue.mustache index f0401f50..cf9db3cf 100644 --- a/src/app/templates/issue.mustache +++ b/src/app/templates/issue.mustache @@ -39,7 +39,6 @@ -