Merge pull request 'don't spam logs with (unsuccessful) wordpress login attempts' (#189) from staging into main
Reviewed-on: #189
This commit is contained in:
commit
4ecdc8968f
@ -501,7 +501,20 @@ ORDER BY last_access DESC
|
||||
pub async fn login(db: &SqlitePool, name: &str, pw: &str) -> Result<Self, LoginError> {
|
||||
let name = name.trim(); // just to make sure...
|
||||
let Some(user) = User::find_by_name(db, name).await else {
|
||||
if ![
|
||||
"n-sageder",
|
||||
"p-hofer",
|
||||
"m-birner",
|
||||
"s-sollberger",
|
||||
"d-kortschak",
|
||||
"wwwadmin",
|
||||
"wadminw",
|
||||
"admin",
|
||||
]
|
||||
.contains(&name)
|
||||
{
|
||||
Log::create(db, format!("Username ({name}) not found (tried to login)")).await;
|
||||
}
|
||||
return Err(LoginError::InvalidAuthenticationCombo); // Username not found
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user