diff --git a/src/data.rs b/src/data.rs index 97ae952..b4f3015 100644 --- a/src/data.rs +++ b/src/data.rs @@ -540,10 +540,12 @@ pub fn w_refresh(res: &str) { let mut f = fs::File::create(f.clone()).unwrap(); let mut ff = fs::File::create(ff.clone()).unwrap(); f.write_all(&res.as_bytes()).unwrap(); - let json: Token = serde_json::from_str(&res).unwrap(); + let token = data_toml(&"access"); + let refresh = data_toml(&"refresh"); + //let json: Token = serde_json::from_str(&res).unwrap(); let refreshs = Refresh { - access: json.accessJwt.to_string(), - refresh: json.refreshJwt.to_string(), + access: token.to_string(), + refresh: refresh.to_string(), }; let toml = toml::to_string(&refreshs).unwrap(); ff.write_all(&toml.as_bytes()).unwrap();