tsk-55: Utilize the expiration methods in icarus_models #59
@@ -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> {
|
||||||
|
|||||||
Reference in New Issue
Block a user