From ddfd5a088e3aa77b6e0194b1fcb530ef948cdd5b Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 27 Feb 2011 09:45:45 +0100 Subject: [PATCH] Append xsrf_token if defined to API calls. Signed-off-by: Florent Bruneau --- htdocs/javascript/core.js | 4 ++++ 1 file changed, 4 insertions(+) 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', -- 2.1.4