more clippy :-)
This commit is contained in:
@ -161,20 +161,17 @@ ORDER BY last_access DESC
|
||||
//been deleted
|
||||
}
|
||||
|
||||
match user.pw.as_ref() {
|
||||
Some(user_pw) => {
|
||||
let password_hash = &Self::get_hashed_pw(pw);
|
||||
if password_hash == user_pw {
|
||||
Log::create(db, format!("User {name} successfully logged in")).await;
|
||||
return Ok(user);
|
||||
}
|
||||
Log::create(db, format!("User {name} supplied the wrong PW")).await;
|
||||
Err(LoginError::InvalidAuthenticationCombo)
|
||||
}
|
||||
None => {
|
||||
info!("User {name} has no PW set");
|
||||
Err(LoginError::NoPasswordSet(user))
|
||||
if let Some(user_pw) = user.pw.as_ref() {
|
||||
let password_hash = &Self::get_hashed_pw(pw);
|
||||
if password_hash == user_pw {
|
||||
Log::create(db, format!("User {name} successfully logged in")).await;
|
||||
return Ok(user);
|
||||
}
|
||||
Log::create(db, format!("User {name} supplied the wrong PW")).await;
|
||||
Err(LoginError::InvalidAuthenticationCombo)
|
||||
} else {
|
||||
info!("User {name} has no PW set");
|
||||
Err(LoginError::NoPasswordSet(user))
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user