scope user id check to idp in create idp user

This commit is contained in:
miloschwartz
2025-09-04 15:23:51 -07:00
parent e69fbf3ccf
commit 0a4b74b91a

View File

@@ -141,7 +141,12 @@ export async function createOrgUser(
const [existingUser] = await trx
.select()
.from(users)
.where(eq(users.username, username));
.where(
and(
eq(users.username, username),
eq(users.idpId, idpId)
)
);
if (existingUser) {
const [existingOrgUser] = await trx