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