Skip to content

Commit c892268

Browse files
Fix issue with linking default user to org in single tenant + no-auth mode
1 parent d8fd958 commit c892268

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

packages/web/src/initialize.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,19 @@ const initSingleTenancy = async () => {
5454
},
5555
data: {
5656
members: {
57-
create: {
58-
role: OrgRole.MEMBER,
59-
user: {
60-
connect: { id: SINGLE_TENANT_USER_ID }
57+
upsert: {
58+
where: {
59+
orgId_userId: {
60+
orgId: SINGLE_TENANT_ORG_ID,
61+
userId: SINGLE_TENANT_USER_ID,
62+
}
63+
},
64+
update: {},
65+
create: {
66+
role: OrgRole.MEMBER,
67+
user: {
68+
connect: { id: SINGLE_TENANT_USER_ID }
69+
}
6170
}
6271
}
6372
}

0 commit comments

Comments
 (0)