summaryrefslogtreecommitdiffstats
path: root/ozone/src/auth.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ozone/src/auth.rs')
-rw-r--r--ozone/src/auth.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/ozone/src/auth.rs b/ozone/src/auth.rs
index 9e8f6d8..0ca96ad 100644
--- a/ozone/src/auth.rs
+++ b/ozone/src/auth.rs
@@ -99,7 +99,7 @@ fn build_json_request(client: &reqwest::Client, url: impl IntoUrl, method: Metho
.header(reqwest::header::ACCEPT, "application/json")
}
-impl MsaUser {
+impl MsaAccount {
pub fn create_client() -> reqwest::Client {
util::build_client()
.redirect(reqwest::redirect::Policy::none())
@@ -270,7 +270,9 @@ impl MsaUser {
}
pub async fn log_in_silent(&mut self, client: &reqwest::Client) -> Result<(), AuthError> {
- let now: DateTime<Utc> = DateTime::from(SystemTime::now()) + TimeDelta::hours(12);
+ // see it's kind of funny that I call this variable "now" despite the fact that it's
+ // unconditionally 12 hours in the future - figboot
+ let now = Utc::now() + TimeDelta::hours(12);
self.ensure_xbl(client, now).await?;
self.ensure_mc_token(client, now).await?;
@@ -290,9 +292,9 @@ mod test {
simple_logger::SimpleLogger::new().with_colors(true).with_level(log::LevelFilter::Trace).init().unwrap();
let mut user = match tokio::fs::read_to_string("../test_stuff/test.json").await {
- Ok(s) => serde_json::from_str::<MsaUser>(&s).unwrap(),
+ Ok(s) => serde_json::from_str::<MsaAccount>(&s).unwrap(),
Err(e) if e.kind() == tokio::io::ErrorKind::NotFound => {
- MsaUser {
+ MsaAccount {
player_profile: None,
xuid: None,
gamertag: None,
@@ -308,7 +310,7 @@ mod test {
Err(e) => panic!("i/o error: {}", e)
};
- let client = MsaUser::create_client();
+ let client = MsaAccount::create_client();
loop {
match user.log_in_silent(&client).await {