Compare commits

..

4 Commits

Author SHA1 Message Date
3d340bf803 Merge pull request 'case-insensitive-auth' (#549) from case-insensitive-auth into staging
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m27s
CI/CD Pipeline / deploy-staging (push) Successful in 6m54s
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #549
2024-05-27 08:33:03 +02:00
86f7ca7065 don't care about cases for username
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m38s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-05-27 08:32:00 +02:00
e325e0478a Merge pull request 'better spacing' (#548) from fix-spacing into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 10m34s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 7m57s
Reviewed-on: #548
2024-05-26 18:48:07 +02:00
02ff89ba34 Merge pull request 'fix spacing' (#546) from fix-spacing into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m57s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 7m38s
Reviewed-on: #546
2024-05-26 14:18:13 +02:00

View File

@ -491,7 +491,7 @@ WHERE id like ?
"
SELECT id, name, pw, deleted, last_access, dob, weight, sex, member_since_date, birthdate, mail, nickname, notes, phone, address, family_id
FROM user
WHERE name=?
WHERE lower(name)=?
",
name
)
@ -705,8 +705,8 @@ 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 {
let name = name.trim().to_lowercase(); // just to make sure...
let Some(user) = User::find_by_name(db, &name).await else {
if ![
"n-sageder",
"p-hofer",
@ -737,7 +737,7 @@ ORDER BY last_access DESC
"d.kortschak",
"[login]",
]
.contains(&name)
.contains(&name.as_str())
{
Log::create(db, format!("Username ({name}) not found (tried to login)")).await;
}