From: Kradyz <81911574+Kradyz@users.noreply.github.com> Date: Wed, 26 Jan 2022 18:05:07 +0000 (+0100) Subject: Case-insensitive username at login (#2010) X-Git-Url: http://these/git/%22https:/www.exeterceilidhs.net/%22%7B%7D/%7B%7D/static/gitweb.js?a=commitdiff_plain;h=1c5c02e1bf561f8e732e09b68b010045c8051e40;p=lemmy.git Case-insensitive username at login (#2010) * Case-insensitive username at login * formatting Co-authored-by: Kradyz --- diff --git a/crates/db_views/src/local_user_view.rs b/crates/db_views/src/local_user_view.rs index 23e81d36..e2453a40 100644 --- a/crates/db_views/src/local_user_view.rs +++ b/crates/db_views/src/local_user_view.rs @@ -1,6 +1,7 @@ use diesel::{result::Error, *}; use lemmy_db_schema::{ aggregates::person_aggregates::PersonAggregates, + functions::lower, newtypes::{LocalUserId, PersonId}, schema::{local_user, person, person_aggregates}, source::{ @@ -81,8 +82,8 @@ impl LocalUserView { .inner_join(person::table) .inner_join(person_aggregates::table.on(person::id.eq(person_aggregates::person_id))) .filter( - person::name - .eq(name_or_email) + lower(person::name) + .eq(lower(name_or_email)) .or(local_user::email.eq(name_or_email)), ) .select((