19 lines
285 B
PHP
19 lines
285 B
PHP
|
<?php
|
||
|
|
||
|
namespace kernel\middlewares;
|
||
|
|
||
|
use kernel\Middleware;
|
||
|
|
||
|
class AuthMiddleware extends Middleware
|
||
|
{
|
||
|
|
||
|
function handler()
|
||
|
{
|
||
|
if(!isset($_COOKIE['user_id']))
|
||
|
{
|
||
|
header('Location: /admin/login', true, 302);
|
||
|
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
}
|