diff --git a/crates/defguard_core/src/db/models/authentication_key.rs b/crates/defguard_core/src/db/models/authentication_key.rs index 260ab50feb..5f95109448 100644 --- a/crates/defguard_core/src/db/models/authentication_key.rs +++ b/crates/defguard_core/src/db/models/authentication_key.rs @@ -11,7 +11,7 @@ pub enum AuthenticationKeyType { Gpg, } -#[derive(Deserialize, Model, Serialize)] +#[derive(Clone, Deserialize, Model, Serialize)] #[table(authentication_key)] pub struct AuthenticationKey { pub(crate) id: I, diff --git a/crates/defguard_core/src/handlers/ssh_authorized_keys.rs b/crates/defguard_core/src/handlers/ssh_authorized_keys.rs index 7916dd667d..35adb62fc7 100644 --- a/crates/defguard_core/src/handlers/ssh_authorized_keys.rs +++ b/crates/defguard_core/src/handlers/ssh_authorized_keys.rs @@ -248,7 +248,7 @@ pub async fn delete_authentication_key( if !session.is_admin && user.id != key.user_id { return Err(WebError::Forbidden(String::new())); } - + key.clone().delete(&appstate.pool).await?; info!( "Removed key \"{:?}\"({}) of type {:?} for user {username}", key.name, key.id, key.key_type