mirror of
https://github.com/bitwarden/server.git
synced 2025-04-08 14:38:15 -05:00
more info on bans/blocks
This commit is contained in:
parent
cdddffc977
commit
38ee251f72
@ -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)));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user