From 62f10a232f2e5c40f8ca83146566db991b729d29 Mon Sep 17 00:00:00 2001 From: David Gwilliam Date: Tue, 31 Mar 2026 04:41:01 -0700 Subject: [PATCH] fix: parse TRUSTED_ORIGINS environment variable for Better Auth --- src/lib/auth.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/auth.ts b/src/lib/auth.ts index 70464ed..a650a7e 100644 --- a/src/lib/auth.ts +++ b/src/lib/auth.ts @@ -21,6 +21,8 @@ export const auth = betterAuth({ process.env.BETTER_AUTH_URL || "http://localhost:3000", "http://127.0.0.1:3000", "http://0.0.0.0:3000", + // Parse comma-separated TRUSTED_ORIGINS environment variable + ...(process.env.TRUSTED_ORIGINS ? process.env.TRUSTED_ORIGINS.split(',').map(origin => origin.trim()) : []), ], session: { cookieCache: {