Skip to content

Permissions filter doesn't capture ajax requests #1050

Answered by Elvis254
Elvis254 asked this question in Q&A
Discussion options

You must be logged in to vote

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.

namespace CodeIgniter\Shield\Filters;

use CodeIgniter\Filters\FilterInterface;
use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;

/**
 * Group Authorization Filter.
 */
abstract class AbstractAuthFilter implements FilterInterface
{
    /**
     * Ensures the user is logged in and a member of one or
     * more groups as specified in the filter.
     *
     * @param array|null $arguments
     *
     * @return RedirectResponse|void
     */
    public function before(Re…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Elvis254
Comment options

@kenjis
Comment options

@Elvis254
Comment options

@Elvis254
Comment options

Answer selected by Elvis254
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1049 on February 25, 2024 22:14.