From: Florent Bruneau Date: Sun, 27 Feb 2011 08:45:45 +0000 (+0100) Subject: Append xsrf_token if defined to API calls. X-Git-Tag: core/1.1.3~11 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=ddfd5a088e3aa77b6e0194b1fcb530ef948cdd5b;p=platal.git Append xsrf_token if defined to API calls. Signed-off-by: Florent Bruneau --- diff --git a/htdocs/javascript/core.js b/htdocs/javascript/core.js index 3a79984..d863c56 100644 --- a/htdocs/javascript/core.js +++ b/htdocs/javascript/core.js @@ -112,6 +112,10 @@ onSuccess = payload; } + if ($.xsrf_token) { + apicall += '?token=' + $.xsrf_token; + } + return $.ajax(ajaxParams(onSuccess, onError, { url: $.plURL('api/' + $.xapiVersion + '/' + apicall), type: 'POST',