1 changed files with 2 additions and 4 deletions
|
|
@ -207,8 +207,7 @@ pub async fn handle_auth_callback(app: tauri::AppHandle, code: String) -> Result
|
|||
// Store account info
|
||||
let account_json =
|
||||
serde_json::to_string_pretty(&account).map_err(|e| format!("Serialize error: {}", e))?;
|
||||
fs::write(dir.join(ACCOUNT_FILE), account_json)
|
||||
.map_err(|e| format!("Cannot write account info: {}", e))?;
|
||||
write_restricted(&dir.join(ACCOUNT_FILE), &account_json)?;
|
||||
|
||||
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_json =
|
||||
serde_json::to_string_pretty(&account).map_err(|e| format!("Serialize error: {}", e))?;
|
||||
fs::write(dir.join(ACCOUNT_FILE), account_json)
|
||||
.map_err(|e| format!("Cannot write account info: {}", e))?;
|
||||
write_restricted(&dir.join(ACCOUNT_FILE), &account_json)?;
|
||||
|
||||
Ok(account)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue