chore: fix config in demo (#5567)

This commit is contained in:
Alex Yang
2025-10-24 21:10:49 -07:00
committed by GitHub
parent c884f80b0c
commit db9f53a87e
2 changed files with 11 additions and 4 deletions

View File

@@ -1,7 +1,5 @@
import { createAuthClient } from "better-auth/react";
export const authClient = createAuthClient({
baseURL: process.env.NEXT_PUBLIC_BETTER_AUTH_URL || "http://localhost:3000",
});
export const authClient = createAuthClient();
export const { signIn, signOut, useSession } = authClient;

View File

@@ -1,7 +1,16 @@
import { betterAuth } from "better-auth";
const baseURL: string | undefined =
process.env.VERCEL === "1"
? process.env.VERCEL_ENV === "production"
? process.env.BETTER_AUTH_URL
: process.env.VERCEL_ENV === "preview"
? `https://${process.env.VERCEL_URL}`
: undefined
: undefined;
export const auth = betterAuth({
baseURL: process.env.BETTER_AUTH_URL,
baseURL,
secret: process.env.BETTER_AUTH_SECRET,
socialProviders: {