From 4ad6caa26cb6c8e68dafd75de6ea2db3513e1bdb Mon Sep 17 00:00:00 2001 From: philipp Date: Tue, 11 Jul 2023 14:37:48 +0200 Subject: [PATCH] trim string --- src/model/user.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/model/user.rs b/src/model/user.rs index 3fc8cac..7af6579 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -111,6 +111,7 @@ ORDER BY last_access DESC pub async fn login(db: &SqlitePool, name: &str, pw: &str) -> Result { info!("User '{name}' is trying to login..."); + let name = name.trim(); // just to make sure... let Some(user) = User::find_by_name(db, name).await else { info!("Username ({name}) not found"); return Err(LoginError::InvalidAuthenticationCombo); // Username not found