Skip to content

Commit 392522e

Browse files
Copilothotlong
andcommitted
refactor(app-host): conditionally spread authToken to avoid undefined
Address code review feedback: only include authToken in TursoDriver config when the env var is actually set. Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> Agent-Logs-Url: https://github.com/objectstack-ai/spec/sessions/1190de98-61cc-419b-b502-b9728e8e3db8
1 parent 5b47ea9 commit 392522e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

examples/app-host/objectstack.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default defineStack({
3838
// Register Default Driver (Turso — remote mode on Vercel, in-memory for local dev)
3939
new DriverPlugin(new TursoDriver({
4040
url: process.env.TURSO_DATABASE_URL ?? ':memory:',
41-
authToken: process.env.TURSO_AUTH_TOKEN,
41+
...(process.env.TURSO_AUTH_TOKEN && { authToken: process.env.TURSO_AUTH_TOKEN }),
4242
})),
4343
// Authentication — required for production (Vercel) deployments
4444
authPlugin,
@@ -106,7 +106,7 @@ export const PreviewHostExample = defineStack({
106106
new ObjectQLPlugin(),
107107
new DriverPlugin(new TursoDriver({
108108
url: process.env.TURSO_DATABASE_URL ?? ':memory:',
109-
authToken: process.env.TURSO_AUTH_TOKEN,
109+
...(process.env.TURSO_AUTH_TOKEN && { authToken: process.env.TURSO_AUTH_TOKEN }),
110110
})),
111111
authPlugin,
112112
new AppPlugin(CrmApp),

0 commit comments

Comments
 (0)