mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 15:40:47 +00:00
Add orgId to reuse login1/login2 logic for LDAP 2nd step login
This commit is contained in:
@@ -20,10 +20,14 @@ export const userDALFactory = (db: TDbClient) => {
|
||||
|
||||
// USER ENCRYPTION FUNCTIONS
|
||||
// -------------------------
|
||||
const findUserEncKeyByUsername = async (username: string) => {
|
||||
const findUserEncKeyByUsername = async ({ username, orgId }: { username: string; orgId?: string }) => {
|
||||
try {
|
||||
return await db(TableName.Users)
|
||||
.where({ username, isGhost: false })
|
||||
.where({
|
||||
username,
|
||||
...(orgId ? { orgId } : { orgId: null }),
|
||||
isGhost: false
|
||||
})
|
||||
.join(TableName.UserEncryptionKey, `${TableName.Users}.id`, `${TableName.UserEncryptionKey}.userId`)
|
||||
.first();
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user