From 748c9b01d04b13c202f0697a67195b107a46df68 Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Thu, 25 Mar 2021 13:22:42 -0400 Subject: [PATCH] add other login results --- src/steamapi.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/steamapi.rs b/src/steamapi.rs index 76bac4c..b359c35 100644 --- a/src/steamapi.rs +++ b/src/steamapi.rs @@ -182,6 +182,26 @@ impl UserLogin { return LoginResult::TooManyAttempts; } + if login_resp.message.contains("Incorrect login") { + return LoginResult::BadCredentials; + } + + if login_resp.captcha_needed { + return LoginResult::NeedCaptcha; + } + + if login_resp.emailauth_needed { + return LoginResult::NeedEmail; + } + + if login_resp.requires_twofactor { + return LoginResult::Need2FA; + } + + if !login_resp.login_complete { + return LoginResult::BadCredentials; + } + return LoginResult::OtherFailure; }