From 5cfdb84bc290bb0dbd26a20a04ba869b1d6ecaa6 Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Mon, 9 Aug 2021 22:11:09 -0400 Subject: [PATCH] add trace logging for finalize_authenticator --- steamguard/src/steamapi.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/steamguard/src/steamapi.rs b/steamguard/src/steamapi.rs index eff5460..bb9661e 100644 --- a/steamguard/src/steamapi.rs +++ b/steamguard/src/steamapi.rs @@ -421,14 +421,18 @@ impl SteamApiClient { "authenticator_time" => time_2fa.to_string(), }; - let resp: SteamApiResponse = self + let resp = self .post(format!( "{}/ITwoFactorService/FinalizeAddAuthenticator/v0001", STEAM_API_BASE.to_string() )) .form(¶ms) - .send()? - .json()?; + .send()?; + + let text = resp.text()?; + trace!("raw finalize authenticator response: {}", text); + + let resp: SteamApiResponse = serde_json::from_str(text.as_str())?; return Ok(resp.response); } @@ -549,6 +553,7 @@ impl AddAuthenticatorResponse { #[derive(Debug, Clone, Deserialize)] pub struct FinalizeAddAuthenticatorResponse { pub status: i32, + #[serde(deserialize_with = "parse_json_string_as_number")] pub server_time: u64, pub want_more: bool, pub success: bool,