Commit bb29ccf2 authored by Ivar Derksen's avatar Ivar Derksen
Browse files

Skip step to confirm data is going to be issued

parent e340a78c
Pipeline #43956 passed with stage
in 47 seconds
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</head> </head>
<body> <body>
<div class="container"> <div class="container" id="enroll-page" style="display: none;">
<div class="row"> <div class="row">
<div id="logo" class="col-xs-12 col-md-8 col-lg-6 col-md-offset-2 col-lg-offset-3"> <div id="logo" class="col-xs-12 col-md-8 col-lg-6 col-md-offset-2 col-lg-offset-3">
<hr/> <hr/>
......
...@@ -30,6 +30,7 @@ getSetupFromJson(function() { ...@@ -30,6 +30,7 @@ getSetupFromJson(function() {
} }
function irma_session_failed (msg) { function irma_session_failed (msg) {
$("#enroll-page").show();
$("#enroll").prop('disabled', false); $("#enroll").prop('disabled', false);
if(msg === 'CANCELLED') { if(msg === 'CANCELLED') {
showWarning(msg); showWarning(msg);
...@@ -38,23 +39,28 @@ getSetupFromJson(function() { ...@@ -38,23 +39,28 @@ getSetupFromJson(function() {
} }
} }
//set issuing functionality to button $(function() {
$("#enroll").on("click", function() { //set issuing functionality to button
// Clear errors let enrollButton = $("#enroll");
$(".form-group").removeClass("has-error"); enrollButton.on("click", function () {
$("#alert_box").empty(); // Clear errors
//disable enroll button $(".form-group").removeClass("has-error");
$("#enroll").prop('disabled', true); $("#alert_box").empty();
//disable enroll button
irma.startSession(conf.irma_server_url, Cookies.get("jwt"), "publickey") $("#enroll").prop('disabled', true);
.then(({sessionPtr, token}) => irma.handleSession(sessionPtr, {...irma_server_conf, token}))
.then(() => { irma.startSession(conf.irma_server_url, Cookies.get("jwt"), "publickey")
window.location.replace(doneURL); .then(({sessionPtr, token}) => irma.handleSession(sessionPtr, {...irma_server_conf, token}))
}, irma_session_failed); .then(() => {
}); window.location.replace(doneURL);
}, irma_session_failed);
});
//decode the issuing JWT and show the values in a table //decode the issuing JWT and show the values in a table
var decoded = jwt_decode(Cookies.get("jwt")); var decoded = jwt_decode(Cookies.get("jwt"));
displayAttributes(decoded.iprequest.request.credentials) displayAttributes(decoded.iprequest.request.credentials);
enrollButton.click();
});
}); });
Markdown is supported
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