John Kim
John Kim

Reputation: 1872

Cakephp regarding Security Component and CSRF protection

There seems to be a problem with Security component when enabled, I cannot get my AJAX to work on the same controller where it is enabled!

I'm getting below error:

The Request has Been Blackholed

Is there a way to ensure AJAX is actually working with POST requests with Security Component enabled?

I do not want to create another AJAX controller just for this

Thanks

Upvotes: 2

Views: 824

Answers (1)

chetanspeed511987
chetanspeed511987

Reputation: 2025

<?php

 class AppController extends Controller {

 public function beforeFilter() {

    $this->Security->blackHoleCallback = 'blackhole';
   }
}

 ?>

Upvotes: 1

Related Questions