fix: fix expiration date check
This commit is contained in:
parent
278c807fa3
commit
0837092d5f
@ -151,6 +151,12 @@ internal sealed class SessionService : ISessionService
|
|||||||
return false;
|
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> remoteAddressBytes = stackalloc byte[16];
|
||||||
Span<byte> sessionAddressBytes = stackalloc byte[16];
|
Span<byte> sessionAddressBytes = stackalloc byte[16];
|
||||||
if (!remoteIpAddress.TryWriteBytes(remoteAddressBytes, out _) ||
|
if (!remoteIpAddress.TryWriteBytes(remoteAddressBytes, out _) ||
|
||||||
|
Loading…
Reference in New Issue
Block a user