-
PHP Version8.2.0 CodeIgniter4 Version4.4.5 Shield Version1.0.1 Which operating systems have you tested for this bug?Windows Which server did you use?apache DatabaseMariaDB 10.2 Did you customize Shield?I customized the What happened?I made an ajax request on a route protected by a permission expecting to get a Steps to ReproduceEdit the permission filter to capture ajax requests and instead of redirecting to the page specified in Expected OutputA JSON formatted Anything else?No response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The filter is designed to redirect. If you need a different behavior, create your own filter. Another possibility is to extend the filter to return a response without redirecting in the case of Ajax requests. In any case, the current behavior is not a bug. |
Beta Was this translation helpful? Give feedback.
I have edited the
AbstractAuthFilter
to make it capture ajax requests by adding a simple control statement on it. Here is the full code, it perfectly works.