From a386364473bea27ff7b8582bae717ba87d393d63 Mon Sep 17 00:00:00 2001 From: bkellam Date: Sat, 20 Sep 2025 16:43:48 -0700 Subject: [PATCH] fix unauthed user case --- packages/web/src/prisma.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/web/src/prisma.ts b/packages/web/src/prisma.ts index 1908c5fb..1d4b7585 100644 --- a/packages/web/src/prisma.ts +++ b/packages/web/src/prisma.ts @@ -32,14 +32,16 @@ export const userScopedPrismaClientExtension = (userId?: string) => { args.where = { ...args.where, OR: [ - // Only include repos that are permitted to the user, - { - permittedUsers: { - some: { - userId, + // Only include repos that are permitted to the user + ...(userId ? [ + { + permittedUsers: { + some: { + userId, + } } - } - }, + }, + ] : []), // or are public. { isPublic: true,