0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -05:00

refactor(core)!: use case insensitive search for emails

This commit is contained in:
Gao Sun 2022-11-09 15:33:07 +08:00
parent 81aa4cd8ed
commit f82d2a8c4f
No known key found for this signature in database
GPG key ID: 13EBE123E4773688

View file

@ -21,7 +21,7 @@ export const findUserByEmail = async (email: string) =>
envSet.pool.one<User>(sql`
select ${sql.join(Object.values(fields), sql`,`)}
from ${table}
where ${fields.primaryEmail}=${email}
where lower(${fields.primaryEmail})=lower(${email})
`);
export const findUserByPhone = async (phone: string) =>
@ -65,7 +65,7 @@ export const hasUserWithEmail = async (email: string) =>
envSet.pool.exists(sql`
select ${fields.primaryEmail}
from ${table}
where ${fields.primaryEmail}=${email}
where lower(${fields.primaryEmail})=lower(${email})
`);
export const hasUserWithPhone = async (phone: string) =>