From a6faa128eccd872435104348bbc1b5d28e2f0ebb Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 24 Jan 2024 13:09:12 +0100 Subject: [PATCH] don't spam logs with (unsuccessful) wordpress login attempts --- src/model/user.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/model/user.rs b/src/model/user.rs index 51992c1..216355a 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -501,7 +501,20 @@ ORDER BY last_access DESC pub async fn login(db: &SqlitePool, name: &str, pw: &str) -> Result { let name = name.trim(); // just to make sure... let Some(user) = User::find_by_name(db, name).await else { - Log::create(db, format!("Username ({name}) not found (tried to login)")).await; + if ![ + "n-sageder", + "p-hofer", + "m-birner", + "s-sollberger", + "d-kortschak", + "wwwadmin", + "wadminw", + "admin", + ] + .contains(&name) + { + Log::create(db, format!("Username ({name}) not found (tried to login)")).await; + } return Err(LoginError::InvalidAuthenticationCombo); // Username not found };