diff --git a/steam/client/__init__.py b/steam/client/__init__.py index f1ac480..e64c236 100644 --- a/steam/client/__init__.py +++ b/steam/client/__init__.py @@ -89,10 +89,21 @@ class SteamClient(EventEmitter, FeatureBase): self.disconnect() if result in (EResult.AccountLogonDenied, + EResult.InvalidLoginAuthCode, EResult.AccountLoginDeniedNeedTwoFactor, EResult.TwoFactorCodeMismatch, ): - self.emit("auth_code_required", result) + + is_2fa = (result in (EResult.AccountLoginDeniedNeedTwoFactor, + EResult.TwoFactorCodeMismatch, + )) + + if is_2fa: + code_mismatch = (result == EResult.TwoFactorCodeMismatch) + else: + code_mismatch = (result == EResult.InvalidLoginAuthCode) + + self.emit("auth_code_required", is_2fa, code_mismatch) else: self.emit("error", result)