Welcome Guest, Not a member yet? Register   Sign In
Filters not working in CodeIgniter 4
#1

PHP Code:
filter
use Modules\Login\Filters\Auth;
use 
Modules\Login\Filters\Noauth;

public 
$aliases = [
"auth"    => Auth::class,
"noauth"    => Noauth::class,
];

Auth
public function before(RequestInterface $request$arguments null)
{
    if (!session()->get('isAdminLoggedIn')) {
        return redirect()->to(base_url(route_to('admin')));
    }
}

Route
$routes
->get("dashboard""DashboardController::index", ["filter" => "auth"]); 


What is the issue in above code. Filter is not working in CodeIgniter 4. Not working filter auth in dashboard route.
Reply


Messages In This Thread
Filters not working in CodeIgniter 4 - by [email protected] - 07-06-2021, 12:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB