Skip to content

Commit a386364

Browse files
fix unauthed user case
1 parent 8a51fe7 commit a386364

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

packages/web/src/prisma.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ export const userScopedPrismaClientExtension = (userId?: string) => {
3232
args.where = {
3333
...args.where,
3434
OR: [
35-
// Only include repos that are permitted to the user,
36-
{
37-
permittedUsers: {
38-
some: {
39-
userId,
35+
// Only include repos that are permitted to the user
36+
...(userId ? [
37+
{
38+
permittedUsers: {
39+
some: {
40+
userId,
41+
}
4042
}
41-
}
42-
},
43+
},
44+
] : []),
4345
// or are public.
4446
{
4547
isPublic: true,

0 commit comments

Comments
 (0)