trim string

This commit is contained in:
philipp 2023-07-11 14:37:48 +02:00
parent a0afce344f
commit 4ad6caa26c

View File

@ -111,6 +111,7 @@ ORDER BY last_access DESC
pub async fn login(db: &SqlitePool, name: &str, pw: &str) -> Result<Self, LoginError> { pub async fn login(db: &SqlitePool, name: &str, pw: &str) -> Result<Self, LoginError> {
info!("User '{name}' is trying to login..."); 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 { let Some(user) = User::find_by_name(db, name).await else {
info!("Username ({name}) not found"); info!("Username ({name}) not found");
return Err(LoginError::InvalidAuthenticationCombo); // Username not found return Err(LoginError::InvalidAuthenticationCombo); // Username not found