diff --git a/src/client/http_client.rs b/src/client/http_client.rs index e3d18604..02a58c2d 100644 --- a/src/client/http_client.rs +++ b/src/client/http_client.rs @@ -219,11 +219,13 @@ fn store_ticket_info(prefix: &str, server: &str, username: &str, ticket: &str, t let empty = serde_json::map::Map::new(); for (server, info) in data.as_object().unwrap_or(&empty) { - for (_user, uinfo) in info.as_object().unwrap_or(&empty) { - if let Some(timestamp) = uinfo["timestamp"].as_i64() { - let age = now - timestamp; - if age < ticket_lifetime { - new_data[server][username] = uinfo.clone(); + for (user, uinfo) in info.as_object().unwrap_or(&empty) { + if user == username { + if let Some(timestamp) = uinfo["timestamp"].as_i64() { + let age = now - timestamp; + if age < ticket_lifetime { + new_data[server][username] = uinfo.clone(); + } } } }