1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-01 23:31:41 +01:00

include ip in log message. only for self host

This commit is contained in:
Kyle Spearrin 2019-11-22 10:23:11 -05:00
parent d022517762
commit 2693ffeab0

View File

@ -220,8 +220,11 @@ namespace Bit.Core.IdentityServer
twoFactorRequest ? EventType.User_FailedLogIn2fa : EventType.User_FailedLogIn);
}
_logger.LogWarning(Constants.BypassFiltersEventId, "Failed login attempt.{0}",
twoFactorRequest ? " 2FA invalid." : string.Empty);
if(_globalSettings.SelfHosted)
{
_logger.LogWarning(Constants.BypassFiltersEventId, "Failed login attempt{0}{1}",
twoFactorRequest ? ", 2FA invalid." : ".", $" {_currentContext.IpAddress}");
}
await Task.Delay(2000); // Delay for brute force.
context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant,
customResponse: new Dictionary<string, object>