tsk-71: Add token expiration checks #78

Merged
phoenix merged 9 commits from tsk-71 into next-v0.8 2025-10-19 02:18:29 +00:00
Showing only changes of commit 7f4adbdb9d - Show all commits

View File

@@ -28,4 +28,10 @@ impl LoginResult {
pub fn _to_json(&self) -> Result<String, serde_json::Error> {
serde_json::to_string_pretty(&self)
}
pub fn token_expired(&self) -> bool {
let current_time = time::OffsetDateTime::now_utc();
let expired = time::OffsetDateTime::from_unix_timestamp(self.expiration).unwrap();
current_time > expired
}
}