tsk-55: Utilize the expiration methods in icarus_models #59

Merged
phoenix merged 6 commits from tsk-55 into main 2025-10-20 17:45:05 +00:00
Showing only changes of commit 5909a29499 - Show all commits

View File

@@ -27,13 +27,6 @@ pub async fn get_token(
} }
} }
// TODO: Might want to put the functionality within icarus_models at some point
pub async fn did_token_expire(login_result: &icarus_models::login_result::LoginResult) -> bool {
let current_time = time::OffsetDateTime::now_utc();
let expire_time = time::OffsetDateTime::from_unix_timestamp(login_result.expiration).unwrap();
current_time > expire_time
}
pub async fn get_refresh_token( pub async fn get_refresh_token(
app: &crate::config::App, app: &crate::config::App,
) -> Result<icarus_models::login_result::LoginResult, std::io::Error> { ) -> Result<icarus_models::login_result::LoginResult, std::io::Error> {