aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src-tauri/src/core/auth.rs
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2026-01-18 12:39:09 +0800
committerGitHub <noreply@github.com>2026-01-18 12:39:09 +0800
commitd78520b74ee7b01db633035c9c8d33ee809ba04d (patch)
tree30b888202a82a28dbd480340ab231af411037913 /src-tauri/src/core/auth.rs
parent6d82ab2275130f3bafdb7ec664297eb700321526 (diff)
parent373fb81604451f085bf9fbccf9251acb17e400a9 (diff)
downloadDropOut-d78520b74ee7b01db633035c9c8d33ee809ba04d.tar.gz
DropOut-d78520b74ee7b01db633035c9c8d33ee809ba04d.zip
Merge pull request #57 from HsiangNianian/fix/critical-bugs
Diffstat (limited to 'src-tauri/src/core/auth.rs')
-rw-r--r--src-tauri/src/core/auth.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src-tauri/src/core/auth.rs b/src-tauri/src/core/auth.rs
index ac5904c..d5e6c17 100644
--- a/src-tauri/src/core/auth.rs
+++ b/src-tauri/src/core/auth.rs
@@ -6,9 +6,9 @@ use uuid::Uuid;
// This is critical because Microsoft's WAF often blocks requests without a valid UA
fn get_client() -> reqwest::Client {
reqwest::Client::builder()
- .user_agent("DropOut/1.0 (Linux)")
+ .user_agent("DropOut/1.0")
.build()
- .unwrap_or_else(|_| get_client())
+ .unwrap_or_else(|_| reqwest::Client::new())
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -136,7 +136,6 @@ pub async fn refresh_microsoft_token(refresh_token: &str) -> Result<TokenRespons
}
/// Check if a Microsoft account token is expired or about to expire
-#[allow(dead_code)]
pub fn is_token_expired(expires_at: i64) -> bool {
let now = std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)