Append xsrf_token if defined to API calls.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 27 Feb 2011 08:45:45 +0000 (09:45 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 27 Feb 2011 08:45:45 +0000 (09:45 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
htdocs/javascript/core.js

index 3a79984..d863c56 100644 (file)
                 onSuccess = payload;
             }
 
+            if ($.xsrf_token) {
+                apicall += '?token=' + $.xsrf_token;
+            }
+
             return $.ajax(ajaxParams(onSuccess, onError, {
                 url: $.plURL('api/' + $.xapiVersion + '/' + apicall),
                 type: 'POST',