Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: resolved the user id going null

=3368cde12607
diff --git a/backend/src/ee/services/group/group-fns.ts b/backend/src/ee/services/group/group-fns.ts
index c9d527b59c..208165c87c 100644
--- a/backend/src/ee/services/group/group-fns.ts
+++ b/backend/src/ee/services/group/group-fns.ts
@@ -34,7 +34,7 @@ const addAcceptedUsersToGroup = async ({
await userGroupMembershipDAL.insertMany(
users.map((user) => ({
- userId: user.userId,
+ userId: user.id,
groupId: group.id,
isPending: false
})),
@@ -82,7 +82,7 @@ const addAcceptedUsersToGroup = async ({
continue;
}
- const usersToAddProjectKeyFor = users.filter((u) => !userKeysSet.has(`${projectId}-${u.userId}`));
+ const usersToAddProjectKeyFor = users.filter((u) => !userKeysSet.has(`${projectId}-${u.id}`));
if (usersToAddProjectKeyFor.length) {
// there are users who need to be shared keys
@@ -149,7 +149,7 @@ const addAcceptedUsersToGroup = async ({
encryptedKey,
nonce,
senderId: ghostUser.id,
- receiverId: user.userId,
+ receiverId: user.id,
projectId
};
});
diff --git a/backend/src/services/user/user-dal.ts b/backend/src/services/user/user-dal.ts
index 228756898e..1fa5a6e718 100644
--- a/backend/src/services/user/user-dal.ts
+++ b/backend/src/services/user/user-dal.ts
@@ -91,7 +91,9 @@ export const userDALFactory = (db: TDbClient) => {
isGhost: false
})
.whereIn(`${TableName.Users}.id`, userIds)
- .leftJoin(TableName.UserEncryptionKey, `${TableName.Users}.id`, `${TableName.UserEncryptionKey}.userId`);
+ .leftJoin(TableName.UserEncryptionKey, `${TableName.Users}.id`, `${TableName.UserEncryptionKey}.userId`)
+ .select(selectAllTableCols(TableName.Users))
+ .select(db.ref("publicKey").withSchema(TableName.UserEncryptionKey));
} catch (error) {
throw new DatabaseError({ error, name: "Find user enc by user ids batch" });
}