Commit f5ef2379 authored by Ad Schellevis's avatar Ad Schellevis

csrf, don't try to pass tokenkey, ref :...

csrf, don't try to pass tokenkey, ref : https://github.com/phalcon/cphalcon/blob/v3.0.3/phalcon/security.zep#L377
parent 9eeca340
...@@ -175,9 +175,8 @@ class ApiControllerBase extends ControllerRoot ...@@ -175,9 +175,8 @@ class ApiControllerBase extends ControllerRoot
} }
// check for valid csrf on post requests // check for valid csrf on post requests
$csrf_tokenkey = $this->request->getHeader('X_CSRFTOKENKEY'); $csrf_token = $this->request->getHeader('X_CSRFTOKEN');
$csrf_token = $this->request->getHeader('X_CSRFTOKEN'); $csrf_valid = $this->security->checkToken(null, $csrf_token, false);
$csrf_valid = $this->security->checkToken($csrf_tokenkey, $csrf_token, false);
if (($this->request->isPost() || if (($this->request->isPost() ||
$this->request->isPut() || $this->request->isPut() ||
......
...@@ -51,7 +51,6 @@ ...@@ -51,7 +51,6 @@
$.ajaxSetup({ $.ajaxSetup({
'beforeSend': function(xhr) { 'beforeSend': function(xhr) {
xhr.setRequestHeader("X-CSRFToken", "{{ csrf_token }}" ); xhr.setRequestHeader("X-CSRFToken", "{{ csrf_token }}" );
xhr.setRequestHeader("X-CSRFTokenKey", "{{ csrf_tokenKey }}" );
} }
}); });
// propagate ajax error messages // propagate ajax error messages
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment