File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 11import { createAuthClient } from 'better-auth/react' ;
2+ import { env } from './env.mjs' ;
23export const authClient = createAuthClient ( {
34 /** The base URL of the server (optional if you're using the same domain) */
4- baseURL : 'http://localhost:3000' ,
5+ baseURL : env . BETTER_AUTH_URL ,
56} ) ;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ const server = z.object({
1111 BETTER_AUTH_URL : z . preprocess (
1212 // This makes Vercel deployments not fail if you don't set BETTER_AUTH_URL
1313 // Since Better Auth automatically uses the VERCEL_URL if present.
14- ( str ) => process . env . VERCEL_URL ?? str ,
14+ ( str ) => `https:// ${ process . env . VERCEL_URL } ` ?? str ,
1515 // VERCEL_URL doesn't include `https` so it cant be validated as a URL
1616 process . env . VERCEL ? z . string ( ) . min ( 1 ) : z . string ( ) . url ( ) ,
1717 ) ,
You can’t perform that action at this time.
0 commit comments