Welcome Guest, Not a member yet? Register   Sign In
Filters order

(This post was last modified: 02-05-2023, 08:08 AM by ruslan.)


I have CorsFilter global filter set in Config/Filters and custom AuthFilter set in Config/Routes

PHP Code:
$routes->post('uri''SomeConroller::index', ['filter' => 'authFilter']); 

I need CorsFilter filter to be executed first, but authFilter takes precedence, outputs response and CorsFilter is never called
How can i make sure CorsFilter is always executed first?

Now route filters are always executed first.
You cannot change the filter order unless you replace the framework core class.

I sent a PR to change the filter execution order:

Theme © iAndrew 2016 - Forum software by © MyBB