From ab4b8d37dff1fb0819e568b804b5539728f78b98 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Sat, 19 Aug 2023 21:31:52 +0100 Subject: [PATCH] fmt: fmt and clippy --- src/methods/account_recover.rs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/methods/account_recover.rs b/src/methods/account_recover.rs index daddbfa..eb0087f 100644 --- a/src/methods/account_recover.rs +++ b/src/methods/account_recover.rs @@ -440,12 +440,6 @@ pub mod ssh { email: String, } - #[derive(Debug, Deserialize)] - struct RequestResult { - auth: String, - keys: Vec, - } - pub async fn request(mut req: Request) -> tide::Result { let RequestChallenge { user, @@ -459,7 +453,7 @@ pub mod ssh { } let config = &req.state().config; - + // check if //.ssh/authorized_keys exists let root = &config.ssh_root; let path = format!("{}/{}/.ssh/authorized_keys", root, user); @@ -570,12 +564,9 @@ pub mod ssh { if let Ok(x) = AuthorizedKeys::read_file(path) { for entry in x { let key = entry.public_key(); - match key.verify("file", msg, &sig) { - Ok(_) => { - valid = true; - break; - } - Err(_) => {} + if key.verify("file", msg, &sig).is_ok() { + valid = true; + break; } } }