mirror of
https://github.com/bitwarden/server.git
synced 2025-04-07 14:08:13 -05:00
include ip in log message. only for self host
This commit is contained in:
parent
d022517762
commit
2693ffeab0
@ -220,8 +220,11 @@ namespace Bit.Core.IdentityServer
|
|||||||
twoFactorRequest ? EventType.User_FailedLogIn2fa : EventType.User_FailedLogIn);
|
twoFactorRequest ? EventType.User_FailedLogIn2fa : EventType.User_FailedLogIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogWarning(Constants.BypassFiltersEventId, "Failed login attempt.{0}",
|
if(_globalSettings.SelfHosted)
|
||||||
twoFactorRequest ? " 2FA invalid." : string.Empty);
|
{
|
||||||
|
_logger.LogWarning(Constants.BypassFiltersEventId, "Failed login attempt{0}{1}",
|
||||||
|
twoFactorRequest ? ", 2FA invalid." : ".", $" {_currentContext.IpAddress}");
|
||||||
|
}
|
||||||
await Task.Delay(2000); // Delay for brute force.
|
await Task.Delay(2000); // Delay for brute force.
|
||||||
context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant,
|
context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant,
|
||||||
customResponse: new Dictionary<string, object>
|
customResponse: new Dictionary<string, object>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user