php - CakePHP 3 AJAX POST not allowed and returns 403 -


i'm trying create action in cakephp 3.4 receive ajax post request. requests ok.

i've added controller:

public function beforefilter(event $event) {     $this->security->setconfig('unlockedactions', ['fileupload', 'openinghoursplaces']); } 

as described in https://book.cakephp.org/3.0/en/controllers/components/security.html

but nothing, returns 403 on post requests.

my action openinghoursplaces returns "ok" string.

thanks helping me.

403 means unauthorized actions, start marking actions public

$this->auth->allow(['fileupload', 'openinghoursplaces']); 

if works take @ "isauthorized" action (appcontroler.php), sure don't redirect unautorized action if request post.


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -