From 5c77719ce405e5489a759eafce8993cba04e8260 Mon Sep 17 00:00:00 2001 From: Lennart <18233294+lennart-k@users.noreply.github.com> Date: Sun, 17 Aug 2025 15:38:29 +0200 Subject: [PATCH] Add log warning for failed login attempts --- crates/frontend/src/routes/login.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/frontend/src/routes/login.rs b/crates/frontend/src/routes/login.rs index b06d4d1..66eab34 100644 --- a/crates/frontend/src/routes/login.rs +++ b/crates/frontend/src/routes/login.rs @@ -13,7 +13,7 @@ use http::StatusCode; use rustical_store::auth::AuthenticationProvider; use serde::Deserialize; use tower_sessions::Session; -use tracing::instrument; +use tracing::{instrument, warn}; use url::Url; #[derive(Template, WebTemplate)] @@ -98,6 +98,7 @@ pub async fn route_post_login( session.insert("user", user.id).await.unwrap(); Redirect::to(&redirect_uri).into_response() } else { + warn!("Failed password login attempt as {username}"); StatusCode::UNAUTHORIZED.into_response() } }