mirror of
https://github.com/docmost/docmost
synced 2025-03-28 21:13:28 +00:00
Merge pull request #73 from docmost/fix/case-insensitive-email
make emails case-insensitive
This commit is contained in:
commit
07cd650205
@ -6,15 +6,11 @@ import { hashPassword } from '../../../common/helpers';
|
||||
import { dbOrTx } from '@docmost/db/utils';
|
||||
import {
|
||||
InsertableUser,
|
||||
Space,
|
||||
UpdatableUser,
|
||||
User,
|
||||
} from '@docmost/db/types/entity.types';
|
||||
import { PaginationOptions } from '../../pagination/pagination-options';
|
||||
import {
|
||||
executeWithPagination,
|
||||
PaginationResult,
|
||||
} from '@docmost/db/pagination/pagination';
|
||||
import { executeWithPagination } from '@docmost/db/pagination/pagination';
|
||||
import { sql } from 'kysely';
|
||||
|
||||
@Injectable()
|
||||
@ -66,7 +62,7 @@ export class UserRepo {
|
||||
.selectFrom('users')
|
||||
.select(this.baseFields)
|
||||
.$if(includePassword, (qb) => qb.select('password'))
|
||||
.where('email', '=', email)
|
||||
.where(sql`LOWER(email)`, '=', sql`LOWER(${email})`)
|
||||
.where('workspaceId', '=', workspaceId)
|
||||
.executeTakeFirst();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user