File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,13 @@ const server = z.object({
88 NODE_ENV : z . enum ( [ 'development' , 'test' , 'production' ] ) ,
99 DATABASE_URL : z . string ( ) . min ( 1 ) ,
1010 BETTER_AUTH_SECRET : z . string ( ) . min ( 1 ) ,
11- BETTER_AUTH_URL : z . string ( ) . min ( 1 ) ,
11+ BETTER_AUTH_URL : z . preprocess (
12+ // This makes Vercel deployments not fail if you don't set BETTER_AUTH_URL
13+ // Since Better Auth automatically uses the VERCEL_URL if present.
14+ ( str ) => process . env . VERCEL_URL ?? str ,
15+ // VERCEL_URL doesn't include `https` so it cant be validated as a URL
16+ process . env . VERCEL ? z . string ( ) . min ( 1 ) : z . string ( ) . url ( ) ,
17+ ) ,
1218 DISCORD_CLIENT_ID : z . string ( ) . min ( 1 ) ,
1319 DISCORD_CLIENT_SECRET : z . string ( ) . min ( 1 ) ,
1420 GOOGLE_CLIENT_ID : z . string ( ) . min ( 1 ) ,
You can’t perform that action at this time.
0 commit comments