Update various SSO / SAML auth methods to support username

This commit is contained in:
Tuan Dang
2024-02-24 22:17:51 -08:00
parent bfee74ff4e
commit 8c31566e17
14 changed files with 37 additions and 33 deletions
+3 -3
View File
@@ -20,10 +20,10 @@ export const userDALFactory = (db: TDbClient) => {
// USER ENCRYPTION FUNCTIONS
// -------------------------
const findUserEncKeyByEmail = async (email: string) => {
const findUserEncKeyByUsername = async (username: string) => {
try {
return await db(TableName.Users)
.where({ email, isGhost: false })
.where({ username, isGhost: false })
.join(TableName.UserEncryptionKey, `${TableName.Users}.id`, `${TableName.UserEncryptionKey}.userId`)
.first();
} catch (error) {
@@ -119,7 +119,7 @@ export const userDALFactory = (db: TDbClient) => {
return {
...userOrm,
findUserByEmail,
findUserEncKeyByEmail,
findUserEncKeyByUsername,
findUserEncKeyByUserId,
updateUserEncryptionByUserId,
findUserByProjectMembershipId,