Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions apps/app/src/app/(app)/[orgId]/tasks/[taskId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,29 @@ 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) {
console.warn('Could not determine active organization ID in getTask');
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<CommentWithAuthor[]> => {
Expand Down
2 changes: 2 additions & 0 deletions apps/app/src/utils/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions apps/portal/src/app/lib/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Loading