Update Saqel Platform: 2026-08-31 00:19:49
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user