From 17135aef8cce6e9f23cd87f2ed1a29b072c9bd04 Mon Sep 17 00:00:00 2001 From: Xander Bil Date: Sun, 29 Sep 2024 22:57:26 +0200 Subject: [PATCH] hide hostname from public ssh keys --- src/controllers/users_controller.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/controllers/users_controller.rs b/src/controllers/users_controller.rs index c4b1187..0b55d65 100644 --- a/src/controllers/users_controller.rs +++ b/src/controllers/users_controller.rs @@ -70,7 +70,9 @@ pub async fn show_ssh_key<'r>( for line in ssh_keys.lines() { let line = line.trim(); if !line.is_empty() { - keys.push(line.to_string()) + keys.push( + line.split(" ").take(2).collect::>().join(" "), + ) } } }