From 3a9568e28c88dd5bfcba7e77d058359ed1a5b827 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Wed, 30 Mar 2016 17:24:28 +0200 Subject: Web: store session SAML data as soon as we get it --- web/main.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/web/main.js b/web/main.js index 3e2c0a7..ac790d7 100644 --- a/web/main.js +++ b/web/main.js @@ -258,18 +258,17 @@ var guiHandlers = { samlData = jsonObj.data; if (!samlData) return {'tid': message.tid, 'sid': message.sid, 'code': -2, 'message': 'IdP proxy did not return any SAML data'}; if (!samlData.userData) return {'tid': message.tid, 'sid': message.sid, 'code': -3, 'message': 'IdP proxy did not return any SAML user data'}; - message.saml_data = samlData.userData; // add the data from SAML authentication, and forward everything to Python + + // we need the SAML data to be able to perform global logout (saml_logout action) + session.samlData = samlData; + + // add the data from SAML authentication, and forward everything to Python + message.saml_data = samlData.userData; return sendDataToPython(message); }); } - p.then(function (jsonObj) { - if ((jsonObj.code === 0) || (jsonObj.code === 1)) { - // we need the SAML data to be able to perform global logout (saml_logout action) - session.samlData = samlData; - } - session.send(jsonObj); - }) + p.then(session.send) .catch(function (e) { var m = 'Error while trying to process the SAML request using the identity server: ' + e; logException(m, e); -- cgit v1.2.1