Reset temporary account credentials upon turning off bot for wrong ones

This commit is contained in:
Łukasz Domeradzki
2025-06-10 11:07:37 +02:00
parent 6bfc7d5c7f
commit e2194894ce

View File

@@ -2254,6 +2254,22 @@ public sealed class Bot : IAsyncDisposable, IDisposable {
// Likely permanently wrong account credentials
LoginFailures = 0;
// Reset temporary login credentials, as user used wrong ones most likely, allow them to fix their mistake if they start the bot again
if (!BotConfig.IsSteamLoginSet) {
BotConfig.SteamLogin = null;
BotConfig.IsSteamLoginSet = false;
}
if (!BotConfig.IsSteamPasswordSet) {
BotConfig.SteamPassword = null;
BotConfig.IsSteamPasswordSet = false;
}
if (!BotConfig.IsSteamParentalCodeSet) {
BotConfig.SteamParentalCode = null;
BotConfig.IsSteamParentalCodeSet = false;
}
ArchiLogger.LogGenericError(Strings.FormatBotInvalidPasswordDuringLogin(MaxLoginFailures));
await Stop().ConfigureAwait(false);