diff --git a/apps/app/src/app/(app)/[orgId]/tasks/[taskId]/page.tsx b/apps/app/src/app/(app)/[orgId]/tasks/[taskId]/page.tsx index 7918eaedf..2eb334a71 100644 --- a/apps/app/src/app/(app)/[orgId]/tasks/[taskId]/page.tsx +++ b/apps/app/src/app/(app)/[orgId]/tasks/[taskId]/page.tsx @@ -37,6 +37,7 @@ export default async function TaskPage({ } const getTask = async (taskId: string, session: Session) => { + console.log('[getTask] Starting task fetch for:', taskId); const activeOrgId = session?.session.activeOrganizationId; if (!activeOrgId) { @@ -44,14 +45,21 @@ const getTask = async (taskId: string, session: Session) => { return null; } - const task = await db.task.findUnique({ - where: { - id: taskId, - organizationId: activeOrgId, - }, - }); + console.log('[getTask] Querying database for task'); + try { + const task = await db.task.findUnique({ + where: { + id: taskId, + organizationId: activeOrgId, + }, + }); - return task; + console.log('[getTask] Database query successful'); + return task; + } catch (error) { + console.error('[getTask] Database query failed:', error); + throw error; + } }; const getComments = async (taskId: string, session: Session): Promise => { diff --git a/apps/app/src/utils/auth.ts b/apps/app/src/utils/auth.ts index 1eef56bc1..0a4fa825f 100644 --- a/apps/app/src/utils/auth.ts +++ b/apps/app/src/utils/auth.ts @@ -50,6 +50,8 @@ export const auth = betterAuth({ 'http://localhost:3000', 'https://app.trycomp.ai', 'https://app.staging.trycomp.ai', + 'https://portal.trycomp.ai', + 'https://portal.staging.trycomp.ai', ], emailAndPassword: { enabled: true, diff --git a/apps/portal/src/app/lib/auth.ts b/apps/portal/src/app/lib/auth.ts index 258a9c857..856762fed 100644 --- a/apps/portal/src/app/lib/auth.ts +++ b/apps/portal/src/app/lib/auth.ts @@ -15,6 +15,13 @@ export const auth = betterAuth({ // It's important so we can use custom IDs specified in Prisma Schema. generateId: false, }, + trustedOrigins: [ + 'http://localhost:3000', + 'https://app.trycomp.ai', + 'https://app.staging.trycomp.ai', + 'https://portal.trycomp.ai', + 'https://portal.staging.trycomp.ai', + ], secret: process.env.AUTH_SECRET!, plugins: [ organization({