Skip to content

Commit 1933fc4

Browse files
fix(env): schema treatment of empty string (#4862)
1 parent 928bd91 commit 1933fc4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apps/realtime/src/env.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import { z } from 'zod'
33
const EnvSchema = z.object({
44
NODE_ENV: z.enum(['development', 'test', 'production']).default('development'),
55
DATABASE_URL: z.string().url(),
6-
REDIS_URL: z.string().url().optional(),
6+
REDIS_URL: z.preprocess(
7+
(value) => (typeof value === 'string' && value.trim() === '' ? undefined : value),
8+
z.string().url().optional()
9+
),
710
BETTER_AUTH_URL: z.string().url(),
811
BETTER_AUTH_SECRET: z.string().min(32),
912
INTERNAL_API_SECRET: z.string().min(32),

0 commit comments

Comments
 (0)