<?php

namespace App\Middleware;

use App\Core\Middleware\MiddlewareInterface;
use App\Core\Request;
use App\Core\Response;
use App\Core\Session;

class AdminMiddleware implements MiddlewareInterface
{
    public function handle(Request $request): ?Response
    {
        if (Session::get('role') != 3) {
            return Response::redirect('/');
        }
        return null;
    }
}
