Fix LoginLimiter being ignored on non-ASF 2FA accounts

This commit is contained in:
JustArchi
2016-09-28 15:07:52 +02:00
parent 0acef23ffd
commit 0b80e69c4d

View File

@@ -541,11 +541,13 @@ namespace ArchiSteamFarm {
}
// Use limiter only when user is not providing 2FA token by himself
if (string.IsNullOrEmpty(TwoFactorCode) && (BotDatabase.MobileAuthenticator != null)) {
if (string.IsNullOrEmpty(TwoFactorCode)) {
await LimitLoginRequestsAsync().ConfigureAwait(false);
// In this case, we can also use ASF 2FA for providing 2FA token, even if it's not required
TwoFactorCode = await BotDatabase.MobileAuthenticator.GenerateToken().ConfigureAwait(false);
if (BotDatabase.MobileAuthenticator != null) {
// In this case, we can also use ASF 2FA for providing 2FA token, even if it's not required
TwoFactorCode = await BotDatabase.MobileAuthenticator.GenerateToken().ConfigureAwait(false);
}
}
lock (SteamClient) {