backend/kernel/middlewares/AuthMiddleware.php

19 lines
285 B
PHP
Raw Normal View History

2024-10-17 14:55:00 +03:00
<?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;
}
}
}