mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-02 01:01:20 +00:00
Case-insensitive username at login (#2010)
* Case-insensitive username at login * formatting Co-authored-by: Kradyz <k@radiz.nl>
This commit is contained in:
parent
e36ad9d984
commit
1c5c02e1bf
1 changed files with 3 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
use diesel::{result::Error, *};
|
use diesel::{result::Error, *};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
aggregates::person_aggregates::PersonAggregates,
|
aggregates::person_aggregates::PersonAggregates,
|
||||||
|
functions::lower,
|
||||||
newtypes::{LocalUserId, PersonId},
|
newtypes::{LocalUserId, PersonId},
|
||||||
schema::{local_user, person, person_aggregates},
|
schema::{local_user, person, person_aggregates},
|
||||||
source::{
|
source::{
|
||||||
|
@ -81,8 +82,8 @@ impl LocalUserView {
|
||||||
.inner_join(person::table)
|
.inner_join(person::table)
|
||||||
.inner_join(person_aggregates::table.on(person::id.eq(person_aggregates::person_id)))
|
.inner_join(person_aggregates::table.on(person::id.eq(person_aggregates::person_id)))
|
||||||
.filter(
|
.filter(
|
||||||
person::name
|
lower(person::name)
|
||||||
.eq(name_or_email)
|
.eq(lower(name_or_email))
|
||||||
.or(local_user::email.eq(name_or_email)),
|
.or(local_user::email.eq(name_or_email)),
|
||||||
)
|
)
|
||||||
.select((
|
.select((
|
||||||
|
|
Loading…
Reference in a new issue