mirror of
https://github.com/bitwarden/server
synced 2025-12-18 17:23:28 +00:00
more info on bans/blocks
This commit is contained in:
@@ -60,10 +60,11 @@ namespace Bit.Core.Utilities
|
|||||||
if(blockedCount > 10)
|
if(blockedCount > 10)
|
||||||
{
|
{
|
||||||
_blockIpService.BlockIpAsync(identity.ClientIp, false);
|
_blockIpService.BlockIpAsync(identity.ClientIp, false);
|
||||||
_logger.LogInformation($"Blocked {identity.ClientIp}. Request Info: {GetRequestInfo(httpContext)}");
|
_logger.LogInformation($"Banned {identity.ClientIp}. Info: {GetRequestInfo(httpContext)}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation($"Request blocked {identity.ClientIp}. Info: {GetRequestInfo(httpContext)}");
|
||||||
_memoryCache.Set(key, blockedCount,
|
_memoryCache.Set(key, blockedCount,
|
||||||
new MemoryCacheEntryOptions().SetSlidingExpiration(new TimeSpan(0, 5, 0)));
|
new MemoryCacheEntryOptions().SetSlidingExpiration(new TimeSpan(0, 5, 0)));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user