fix: fix expiration date check

This commit is contained in:
Oliver Booth 2024-02-25 14:12:04 +00:00
parent 278c807fa3
commit 0837092d5f
Signed by: oliverbooth
GPG Key ID: E60B570D1B7557B5
1 changed files with 6 additions and 0 deletions

View File

@ -151,6 +151,12 @@ internal sealed class SessionService : ISessionService
return false;
}
if (session.Expires <= DateTimeOffset.UtcNow)
{
_logger.LogInformation("Session {Id} has expired (client {Ip})", session.Id, remoteIpAddress);
return false;
}
Span<byte> remoteAddressBytes = stackalloc byte[16];
Span<byte> sessionAddressBytes = stackalloc byte[16];
if (!remoteIpAddress.TryWriteBytes(remoteAddressBytes, out _) ||