Welcome Guest, Not a member yet? Register   Sign In
public $filters except login page
#1

I work with filter method for check admin users authentication like this:

PHP Code:
class Filters extends BaseConfig
{
    
// Makes reading things below nicer,
    // and simpler to change out script that's used.
    
public $aliases = [
        
'csrf'     => \CodeIgniter\Filters\CSRF::class,
        
'toolbar'  => \CodeIgniter\Filters\DebugToolbar::class,
        
'honeypot' => \CodeIgniter\Filters\Honeypot::class,
        
'auth'     => \App\Filters\Auth::class,
    ];

    
// Always applied before every request
    
public $globals = [
        
'before' => [
            
//'honeypot'
             
'csrf',

        ],
        
'after'  => [
            
'toolbar',
            
//'honeypot'
        
],
    ];

    
// Works on all of a particular HTTP method
    // (GET, POST, etc) as BEFORE filters only
    //     like: 'post' => ['CSRF', 'throttle'],
    
public $methods = [];

    
// List filter aliases and any before/after uri patterns
    // that they should run on, like:
    //    'isLoggedIn' => ['before' => ['account/*', 'profiles/*']],
    
public $filters = [
        'auth' => ['before' => 'admin/*'],
    ];


public filter work for all admin uri (admin/roles  - admin/users - admin/login) but i need to except admin/login because with this method i can not see login page and see browser error:

Code:
This page isn’t working right now
ci4.local redirected you too many times.
ERR_TOO_MANY_REDIRECTS


how do fix this problem?! thanks
Reply


Messages In This Thread
public $filters except login page - by cilux - 03-28-2020, 03:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB