UserSessionRevoker

This commit is contained in:
Artemy
2025-07-24 18:05:11 +07:00
parent 15f9370dbe
commit 6a6c3d513d
4 changed files with 68 additions and 3 deletions
@@ -23,11 +23,12 @@ public class UserSessionReader : IUserSessionReader
{
_logger.LogInformation($"Getting all sessions for user {userId}");
var sessions = await _repository.GetByUserIdAsync(userId);
return sessions;
return sessions.Where(f => !f.IsRevoked).ToList() ?? [];
}
catch (NotFoundByKeyException<Guid> ex)
{
_logger.LogWarning("The user has no active sessions.");
_logger.LogWarning("The user has no sessions.");
return [];
}
}