From 1021c921c5690ceb800c03140de0723f3338e121 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Sun, 18 Jan 2026 12:16:55 +0800 Subject: fix(auth): add token expiry check in start_game Check if the Microsoft account token is expired before attempting to launch the game. If expired, attempt to refresh using the refresh_token. If refresh fails, return an error instructing the user to login again. Also removed #[allow(dead_code)] from is_token_expired since it's now actively used. --- src-tauri/src/core/auth.rs | 1 - 1 file changed, 1 deletion(-) (limited to 'src-tauri/src/core') diff --git a/src-tauri/src/core/auth.rs b/src-tauri/src/core/auth.rs index e1e1588..d5e6c17 100644 --- a/src-tauri/src/core/auth.rs +++ b/src-tauri/src/core/auth.rs @@ -136,7 +136,6 @@ pub async fn refresh_microsoft_token(refresh_token: &str) -> Result bool { let now = std::time::SystemTime::now() .duration_since(std::time::UNIX_EPOCH) -- cgit v1.2.3-70-g09d2