Search code examples
codeigniter-4

how to excluding global filter for a single controller


I'am using Myth-Auth library for my Codeigniter 4 project and I'am enable before login filter globally. So if anyone want to access any controller if they're not logged in will redirect to login page.
My project is an IoT project and I made 1 controller to handle data from NodeMCU. but because i enable the login filter globally, my nodemcu can't access this controller and always redirect to login page.
so my question is how to excluding this global filter only for single controller?
thankyou


Solution

  • already solved
    just add except option on filter config

    public $globals = [
        'before' => [
            'login' => ['except' => ['/Hub/*']] //just add like this
        ],
        'after' => [
            'toolbar'
          ]
        ],
    ];