feat: Maximus Account OAuth2 + machine activation (#51, #53) #65

Merged
maximus merged 7 commits from issue-51-compte-maximus-oauth into main 2026-04-10 19:38:28 +00:00
Showing only changes of commit ca3005bc0e - Show all commits

View file

@ -207,8 +207,7 @@ pub async fn handle_auth_callback(app: tauri::AppHandle, code: String) -> Result
// Store account info // Store account info
let account_json = let account_json =
serde_json::to_string_pretty(&account).map_err(|e| format!("Serialize error: {}", e))?; serde_json::to_string_pretty(&account).map_err(|e| format!("Serialize error: {}", e))?;
fs::write(dir.join(ACCOUNT_FILE), account_json) write_restricted(&dir.join(ACCOUNT_FILE), &account_json)?;
.map_err(|e| format!("Cannot write account info: {}", e))?;
Ok(account) Ok(account)
} }
@ -280,8 +279,7 @@ pub async fn refresh_auth_token(app: tauri::AppHandle) -> Result<AccountInfo, St
let account = fetch_userinfo(&endpoint, &new_access).await?; let account = fetch_userinfo(&endpoint, &new_access).await?;
let account_json = let account_json =
serde_json::to_string_pretty(&account).map_err(|e| format!("Serialize error: {}", e))?; serde_json::to_string_pretty(&account).map_err(|e| format!("Serialize error: {}", e))?;
fs::write(dir.join(ACCOUNT_FILE), account_json) write_restricted(&dir.join(ACCOUNT_FILE), &account_json)?;
.map_err(|e| format!("Cannot write account info: {}", e))?;
Ok(account) Ok(account)
} }