Do not record failed attempts on empty passwords

This commit is contained in:
JustArchi 2019-11-11 22:32:01 +01:00
parent d3c2dabef7
commit 738b70e57a

View file

@ -102,7 +102,13 @@ namespace ArchiSteamFarm.IPC.Integration {
return HttpStatusCode.Unauthorized;
}
bool authorized = passwords.First() == ASF.GlobalConfig.IPCPassword;
string inputPassword = passwords.FirstOrDefault(password => !string.IsNullOrEmpty(password));
if (string.IsNullOrEmpty(inputPassword)) {
return HttpStatusCode.Unauthorized;
}
bool authorized = inputPassword == ASF.GlobalConfig.IPCPassword;
await AuthorizationSemaphore.WaitAsync().ConfigureAwait(false);