trim string
This commit is contained in:
parent
a0afce344f
commit
4ad6caa26c
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user