Update Saqel Platform: 2026-08-31 00:19:49

This commit is contained in:
Hamza-Ayed
2026-08-31 00:19:49 +03:00
parent c4c59bc828
commit 4e29915383
2 changed files with 8 additions and 5 deletions
+3 -2
View File
@@ -36,11 +36,12 @@ class AuthMiddleware
}
$userId = (int)$payload['user_id'];
$role = (string)($payload['role'] ?? 'student');
// Check if session is active in Redis (Single Active Device / Session Tracking)
// Check if session is active in Redis (Role-isolated single active session tracking)
try {
$redis = RedisClient::getInstance();
$sessionData = $redis->get("active_session:{$userId}");
$sessionData = $redis->get("active_session:{$role}:{$userId}") ?: $redis->get("active_session:{$userId}");
if ($sessionData) {
$session = json_decode($sessionData, true);