admin 12
This commit is contained in:
@@ -11,7 +11,8 @@ require_once __DIR__ . '/../../core/bootstrap.php';
|
|||||||
use Firebase\JWT\JWT;
|
use Firebase\JWT\JWT;
|
||||||
|
|
||||||
// التحقق من الجلسة الحالية للأدمن
|
// التحقق من الجلسة الحالية للأدمن
|
||||||
$admin = authenticateJWT();
|
$jwtService = new JwtService($redis ?? null);
|
||||||
|
$admin = $jwtService->authenticate();
|
||||||
|
|
||||||
if ($admin->role !== 'admin') {
|
if ($admin->role !== 'admin') {
|
||||||
jsonError("Unauthorized. Admin access required.");
|
jsonError("Unauthorized. Admin access required.");
|
||||||
|
|||||||
Reference in New Issue
Block a user