From b5020a93302f1d1821dc3bffef78f16eb88b1550 Mon Sep 17 00:00:00 2001 From: Claudio Fuentes Date: Fri, 1 Aug 2025 15:13:20 -0400 Subject: [PATCH] refactor: update trusted origins in auth configuration for better flexibility - Simplified the trustedOrigins array in the auth configuration by consolidating multiple entries into a wildcard pattern for the trycomp.ai domain. - Retained the localhost entry for local development, ensuring a smoother development experience while maintaining security in production environments. --- apps/app/src/utils/auth.ts | 8 +------- apps/portal/src/app/lib/auth.ts | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/apps/app/src/utils/auth.ts b/apps/app/src/utils/auth.ts index 558d6cdac..76ff4b8b7 100644 --- a/apps/app/src/utils/auth.ts +++ b/apps/app/src/utils/auth.ts @@ -48,13 +48,7 @@ export const auth = betterAuth({ provider: 'postgresql', }), baseURL: process.env.BETTER_AUTH_URL, - trustedOrigins: [ - // 'http://localhost:3000', - 'https://app.trycomp.ai', - // 'https://app.staging.trycomp.ai', - // 'https://portal.trycomp.ai', - // 'https://portal.staging.trycomp.ai', - ], + trustedOrigins: ['http://localhost:3000', 'https://*.trycomp.ai'], emailAndPassword: { enabled: true, }, diff --git a/apps/portal/src/app/lib/auth.ts b/apps/portal/src/app/lib/auth.ts index 691803324..97c6427f1 100644 --- a/apps/portal/src/app/lib/auth.ts +++ b/apps/portal/src/app/lib/auth.ts @@ -15,13 +15,7 @@ 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', - ], + trustedOrigins: ['http://localhost:3000', 'https://*.trycomp.ai'], secret: process.env.AUTH_SECRET!, plugins: [ organization({