Skip to content

Commit a5ce061

Browse files
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 <[email protected]>
1 parent 024294b commit a5ce061

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

apps/app/src/utils/auth.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ export const auth = betterAuth({
4444
provider: 'postgresql',
4545
}),
4646
baseURL: process.env.NEXT_PUBLIC_BETTER_AUTH_URL,
47-
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'],
47+
trustedOrigins: process.env.AUTH_TRUSTED_ORIGINS
48+
? process.env.AUTH_TRUSTED_ORIGINS.split(',').map((o) => o.trim())
49+
: ['http://localhost:3000', 'https://*.trycomp.ai', 'http://localhost:3002'],
4850
emailAndPassword: {
4951
enabled: true,
5052
},
@@ -109,6 +111,7 @@ export const auth = betterAuth({
109111
secret: process.env.AUTH_SECRET!,
110112
plugins: [
111113
organization({
114+
membershipLimit: 100000000000,
112115
async sendInvitationEmail(data) {
113116
const isLocalhost = process.env.NODE_ENV === 'development';
114117
const protocol = isLocalhost ? 'http' : 'https';

apps/portal/src/app/lib/auth.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const auth = betterAuth({
1919
secret: process.env.AUTH_SECRET!,
2020
plugins: [
2121
organization({
22+
membershipLimit: 100000000000,
2223
async sendInvitationEmail(data) {
2324
console.log(
2425
'process.env.NEXT_PUBLIC_BETTER_AUTH_URL',

0 commit comments

Comments
 (0)