Add baseURL and basePath to Better Auth config

This commit is contained in:
Chris Scott committed 2026-01-24 18:35:16 -05:00
1 parent ddb3ce214d
commit 10fd14ac4d
1 file changed
+4
+4
View File
@@ -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()),