Skip to content

Commit

Permalink
Merge pull request #770 from steven-v/master
Browse files Browse the repository at this point in the history
update csrf token in ajax headers
  • Loading branch information
markstory authored Jul 29, 2020
2 parents 801086c + 9a4458f commit 6ca239b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion templates/element/cache_panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function showMessage(el, text) {
var messageEl = el.parent().find('.inline-message');

var xhr = $.ajax({
headers: {'X-CSRF-TOKEN': '<?= $this->request->getParam('_csrfToken') ?>'},
headers: {'X-CSRF-TOKEN': '<?= $this->request->getAttribute('csrfToken') ?>'},
url: baseUrl,
data: {name: name},
dataType: 'json',
Expand Down
2 changes: 1 addition & 1 deletion templates/element/packages_panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function buildErrorMessage(response) {
showMessage(terminal, buildLoader());
var direct = $('.direct-dependency')[0].checked;
var xhr = $.ajax({
headers: {'X-CSRF-TOKEN': '<?= $this->request->getParam('_csrfToken') ?>'},
headers: {'X-CSRF-TOKEN': '<?= $this->request->getAttribute('csrfToken') ?>'},
url: baseUrl,
data: {direct: direct},
dataType: 'json',
Expand Down

0 comments on commit 6ca239b

Please sign in to comment.