Merge pull request #3646 from barronpm/incrementcount-async

Make IncrementInvalidLoginAttemptCount async.
This commit is contained in:
Bond-009 2020-07-22 13:53:10 +02:00 committed by GitHub
commit 3c1b2f11e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -512,7 +512,7 @@ namespace Jellyfin.Server.Implementations.Users
}
else
{
IncrementInvalidLoginAttemptCount(user);
await IncrementInvalidLoginAttemptCount(user).ConfigureAwait(false);
_logger.LogInformation(
"Authentication request for {UserName} has been denied (IP: {IP}).",
user.Username,
@ -882,7 +882,7 @@ namespace Jellyfin.Server.Implementations.Users
}
}
private void IncrementInvalidLoginAttemptCount(User user)
private async Task IncrementInvalidLoginAttemptCount(User user)
{
user.InvalidLoginAttemptCount++;
int? maxInvalidLogins = user.LoginAttemptsBeforeLockout;
@ -896,7 +896,7 @@ namespace Jellyfin.Server.Implementations.Users
user.InvalidLoginAttemptCount);
}
UpdateUser(user);
await UpdateUserAsync(user).ConfigureAwait(false);
}
}
}