Make WebCookie optional in Session

The maFile from Steam Desktop Authenticator may set this field to null
This commit is contained in:
Yoav Shai 2022-01-15 02:21:36 +02:00
parent ccc087b797
commit 4900a2ede7

View file

@ -99,7 +99,7 @@ pub struct Session {
#[serde(rename = "SteamLoginSecure")]
pub steam_login_secure: String,
#[serde(default, rename = "WebCookie")]
pub web_cookie: String,
pub web_cookie: Option<String>,
#[serde(rename = "OAuthToken")]
pub token: String,
#[serde(rename = "SteamID")]
@ -153,7 +153,7 @@ impl SteamApiClient {
session_id: self
.extract_session_id()
.expect("failed to extract session id from cookies"),
web_cookie: data.webcookie.clone(),
web_cookie: Some(data.webcookie.clone()),
};
}