From 10fd14ac4d27c1fb29e1659a7fe40b12e49be5d5 Mon Sep 17 00:00:00 2001 From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com> Date: Sat, 24 Jan 2026 18:35:16 -0500 Subject: [PATCH] Add baseURL and basePath to Better Auth config --- backend/src/auth/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/src/auth/index.ts b/backend/src/auth/index.ts index c560c7ee..147222d8 100644 --- a/backend/src/auth/index.ts +++ b/backend/src/auth/index.ts @@ -29,7 +29,11 @@ export function createAuth(db: Database) { } } + const baseURL = ENV.AUTH.TRUSTED_ORIGINS.split(',')[0]?.trim() || `http://localhost:${ENV.SERVER.PORT}` + const auth = betterAuth({ + baseURL, + basePath: '/api/auth', database: db, secret: ENV.AUTH.SECRET, trustedOrigins: ENV.AUTH.TRUSTED_ORIGINS.split(',').map((o: string) => o.trim()),