From 84ea6e951d7b3c8e540b76fb6b358806b265be62 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 10:59:43 -0400 Subject: [PATCH] Enhance Better Auth configuration with membership limit and formatting improvements (#1456) - Updated the `trustedOrigins` configuration in `auth.ts` to improve readability and maintainability. - Set a `membershipLimit` of 100 billion in the organization plugin for Better Auth in both `auth.ts` files. These changes streamline the authentication setup and enhance the handling of organization memberships. Co-authored-by: Mariano Fuentes --- apps/app/src/utils/auth.ts | 5 ++++- apps/portal/src/app/lib/auth.ts | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/app/src/utils/auth.ts b/apps/app/src/utils/auth.ts index 5f133ea83..a66f6da1f 100644 --- a/apps/app/src/utils/auth.ts +++ b/apps/app/src/utils/auth.ts @@ -44,7 +44,9 @@ export const auth = betterAuth({ provider: 'postgresql', }), baseURL: process.env.NEXT_PUBLIC_BETTER_AUTH_URL, - trustedOrigins: process.env.AUTH_TRUSTED_ORIGINS ? process.env.AUTH_TRUSTED_ORIGINS.split(",").map(o => o.trim()) : ['http://localhost:3000', 'https://*.trycomp.ai', 'http://localhost:3002'], + trustedOrigins: process.env.AUTH_TRUSTED_ORIGINS + ? process.env.AUTH_TRUSTED_ORIGINS.split(',').map((o) => o.trim()) + : ['http://localhost:3000', 'https://*.trycomp.ai', 'http://localhost:3002'], emailAndPassword: { enabled: true, }, @@ -109,6 +111,7 @@ export const auth = betterAuth({ secret: process.env.AUTH_SECRET!, plugins: [ organization({ + membershipLimit: 100000000000, async sendInvitationEmail(data) { const isLocalhost = process.env.NODE_ENV === 'development'; const protocol = isLocalhost ? 'http' : 'https'; diff --git a/apps/portal/src/app/lib/auth.ts b/apps/portal/src/app/lib/auth.ts index 22a7fc74e..b7eadfcb3 100644 --- a/apps/portal/src/app/lib/auth.ts +++ b/apps/portal/src/app/lib/auth.ts @@ -19,6 +19,7 @@ export const auth = betterAuth({ secret: process.env.AUTH_SECRET!, plugins: [ organization({ + membershipLimit: 100000000000, async sendInvitationEmail(data) { console.log( 'process.env.NEXT_PUBLIC_BETTER_AUTH_URL',