CSRF protection

This commit is contained in:
andryyy
2017-05-15 11:37:12 +02:00
parent fccdabb113
commit e91c6916ab
6 changed files with 37 additions and 23 deletions

View File

@@ -43,7 +43,7 @@ $(document).ready(function() {
$.ajax({
type: "POST",
dataType: "json",
data: { "items": JSON.stringify(data_array), "attr": JSON.stringify(api_attr) },
data: { "items": JSON.stringify(data_array), "attr": JSON.stringify(api_attr), "csrf_token": csrf_token },
url: '/api/v1/' + api_url,
jsonp: false,
complete: function (data) {
@@ -76,7 +76,7 @@ $(document).ready(function() {
$.ajax({
type: "POST",
dataType: "json",
data: { "items": JSON.stringify(data_array) },
data: { "items": JSON.stringify(data_array), "csrf_token": csrf_token },
url: '/api/v1/' + api_url,
jsonp: false,
complete: function (data) {