summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-03-30 17:24:28 +0200
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-03-30 17:24:28 +0200
commit3a9568e28c88dd5bfcba7e77d058359ed1a5b827 (patch)
treedac5e2c024c272a66969ebf61d2ef1e697cf6173
parent880c601c90a229340892b680dbce0e09c6aaeedb (diff)
Web: store session SAML data as soon as we get it
-rw-r--r--web/main.js15
1 files 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);